微信支付 退款通知訊息AES 256 ECB解密

2021-09-25 11:34:40 字數 973 閱讀 7485

拿到了reqinfo加密字串,需要按照一下步驟解密。

(3)用key*對加密串b做aes-256-ecb解密(pkcs7padding)

**如下:

@test

public void refundnotifytest()catch (exception e)

}//金鑰演算法

private static final string algorithm = "aes";

//加解密演算法/工作模式/填充方式

private static final string algorithm_mode_padding = "aes/ecb/pkcs7padding";

//生成key

private static secretkeyspec key = new secretkeyspec(signutil.md5("api金鑰", "utf-8").tolowercase().getbytes(), algorithm);

/*** aes解密

* @param base64data

* @return

* @throws exception

*/public static string decryptdata(byte base64data) throws exception

抱錯資訊為:

cannot find any provider supporting aes/ecb/pkcs7padding

org.bouncycastle

bcprov-ext-jdk16

1.46

decryptdata方法新增:

security.addprovider(new org.bouncycastle.jce.provider.bouncycastleprovider());
執行解密成功。

微信支付 退款篇

快速搭建指南 安裝配置nginx phpfpm php 建sdk解壓到 根目錄 修改lib wxpay.config.php為自己申請的商戶號的資訊 配置詳見說明 cert下的檔案 退款是需要用到證書的。搭建完成 遇見問題1 解決方法 配置檔案中的證書路徑必須寫絕對路徑,且如下 wxpay.conf...

微信退款申請成功非同步通知使用AES解密問題

1.對返回的加密串req info做base64解碼,得到另乙個加密串 byte b base64util.decode map.get req info secretkeyspec key new secretkeyspec md5util.md5encode wechat key tolower...

微信支付 退款 v3版微信支付

證書 apiclient cert.p12。jar包 commons codec 1.6.jar commons logging 1.1.3.jar fluent hc 4.3.4.jar httpclient 4.3.4.jar httpclient cache 4.3.4.jar httpcor...