Caused by: java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
at javax.crypto.Cipher.implInit(Cipher.java:805)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1396)
at javax.crypto.Cipher.init(Cipher.java:1327)
at com.wechat.pay.java.core.cipher.AbstractAeadCipher.decrypt(AbstractAeadCipher.java:71)
报错代码:
// 使用自动更新平台证书的RSA配置
// 建议将 config 作为单例或全局静态对象,避免重复的下载浪费系统资源
Config config = new RSAAutoCertificateConfig.Builder().merchantId(merchantId).privateKeyFromPath(privateKeyPath)
.merchantSerialNumber(merchantSerialNumber).apiV3Key(apiV3key).build();