https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=4_1
-
MD5
- HASH/MD5/Test2
-
HMAC-SHA256
- MAC/HMAC_SHA256/Test2
https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_3.shtml
-
SHA256withRSA
https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay3_2.shtml
-
AES/GCM/NoPadding
https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml
-
RSA/ECB/OAEPWithSHA-1AndMGF1Padding
-
AES/CBC/NoPadding
- CRYPTO/AES_CBC_NOPADDING/Test3
- CRYPTO/AES_CBC_NOPADDING/Test4
-
SHA1
- HASH/SHA1/Test3
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html
-
SHA1
- HASH/SHA1/Test2
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html
-
AES/CBC/PKCS7PADDING
- CRYPTO/AES_CBC_PKCS7PADDING/Test3
- CRYPTO/AES_CBC_PKCS7PADDING/Test4
https://opendocs.alipay.com/common/02mse3 https://github.com/alipay/alipay-sdk-net-all/blob/master/v2/AlipaySDKNet.Standard/Util/AlipayEncrypt.cs
-
AES_CBC_PKCS7PADDING
- CRYPTO/AES_CBC_PKCS7PADDING/Test7
- CRYPTO/AES_CBC_PKCS7PADDING/Test8
-
SHA256WITHRSA
- SIGN/SHA256_WITH_RSA/Test6
https://open.dingtalk.com/document/org/configure-event-subcription
-
AES/CBC/NOPADDING
- CRYPTO/AES_CBC_NOPADDING/Test5
- CRYPTO/AES_CBC_NOPADDING/Test6
-
SHA1
- HASH/SHA1/Test4
https://open.dingtalk.com/document/robots/customize-robot-security-settings
-
HMAC-SHA256
- MAC/HMAC_SHA256/Test3
-
MD5
- HASH/MD5/Test3
-
HMAC-MD5
- MAC/HMAC_MD5/Test2
// https://try.dot.net/ using System; using System.Linq; using System.Security.Cryptography; using System.Text; public class Program { public static void Main() { string source = "app_key12345678fieldsnum_iid,title,nick,price,numformatjsonmethodtaobao.item.seller.getnum_iid11223344sessiontestsign_methodmd5timestamp2016-01-01 12:00:00v2.0"; string key = "helloworld"; HMACMD5 hmac = new HMACMD5(Encoding.UTF8.GetBytes(key)); byte[] data = hmac.ComputeHash(Encoding.UTF8.GetBytes(source)); string hex = string.Concat(data.Select(x=>x.ToString("X2"))); // B4DDA503460D60A86B16E950E5D303E9 Console.WriteLine(hex); } }
-
HMAC-SHA256
-
HMAC-SHA1
- MAC/HMAC_SHA1/Test2
-
SHA256withRSA
- SIGN/SHA256_WITH_RSA/Test4
财政电子票据对接报文规范-开票报文
财政电子票据对接报文规范-入账报文
财政电子票据对接报文规范-数据交换报文
附录B-消息摘要
-
SHA256
- HASH/SHA256/Test2
-
SM3
- HASH/SM3/Test2
// https://www.jdoodle.com/online-java-compiler-ide/
// Test on JDK 17.0.1
// lib add commons-codec:commons-codec:1.15
import org.apache.commons.codec.digest.DigestUtils;
// lib add org.bouncycastle:bcprov-jdk15on:1.70
import org.bouncycastle.crypto.digests.SM3Digest;
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
import java.io.UnsupportedEncodingException;
public class CzClass {
public static void main(String args[]) {
String xml ="<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>";
System.out.println("xml:"+xml);
String APP_KEY = "TEST_APP_KEY";
System.out.println("APP_KEY:"+APP_KEY);
String source = APP_KEY + xml;
System.out.println("source:"+source);
// sha256
String sha256 = org.apache.commons.codec.digest.DigestUtils.sha256Hex(source);
System.out.println("sha256:"+sha256);
// sm3
try {
byte[] data = source.getBytes("UTF-8");
SM3Digest digest = new SM3Digest();
digest.update(data, 0, data.length);
byte[] hash = new byte[digest.getDigestSize()];
digest.doFinal(hash, 0);
String sm3 = ByteUtils.toHexString(hash);
System.out.println("sm3:"+sm3);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
xml:<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>
APP_KEY:TEST_APP_KEY
source:TEST_APP_KEY<?xml version='1.0' encoding='UTF-8'?><Invoice><Head><MsgNo>8901</MsgNo><Version>1.0</Version><AppId>KPQZDWB5629411</AppId><MsgId>20190522213800999</MsgId><DateTime>20190522213800999</DateTime><Resvered></Resvered></Head><Msg>PFZvdWNoZXI+PFBsYWNlQ29kZT4wMDE8L1BsYWNlQ29kZT48L1ZvdWNoZXI+</Msg></Invoice>
sha256:09be4a8404ae81630c4bc6fb6c58df816a724d48e7ff2dd22ff79d87e43f342a
sm3:34a137b8bba3b6eefbee72eac423eddefc67048ba9e1fa725139ad596e8dedf4
-
RSA/ECB/PKCS1Padding
-
AES/ECB/PKCS5Padding
-
SHA256
-
SHA-256withRSA
腾讯公益与公募机构电子发票对接文档(2023-07-17 15:07)
-
SHA256
- HASH/SHA256/Test3
echo -n 'key1=v1&key2=v2&key3=v3...' | sha256sum
-
HMAC-SHA256
- MAC/HMAC_SHA256/Test4
-
SHA256
- HASH/SHA256/Test4
-
HMAC-SHA1
- Utility/OTP/Test9