wechatpay-apiv3 / wechatpay-apache-httpclient

微信支付 APIv3 Apache HttpClient装饰器(decorator)
https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/index.shtml
Apache License 2.0
674 stars 251 forks source link

密钥超过128位报错 #166

Closed chiangho closed 2 years ago

chiangho commented 2 years ago

ava.lang.IllegalArgumentException: java.security.InvalidKeyException: Illegal key size at com.wechat.pay.contrib.apache.httpclient.util.AesUtil.decryptToString(AesUtil.java:47) ~[wechatpay-apache-httpclient-0.4.7.jar!/:0.4.7] at com.wechat.pay.contrib.apache.httpclient.util.CertSerializeUtil.deserializeToCerts(CertSerializeUtil.java:42) ~[wechatpay-apache-httpclient-0.4.7.jar!/:0.4.7] at com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager.downloadAndUpdateCert(CertificatesManager.java:267) ~[wechatpay-apache-httpclient-0.4.7.jar! at com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager.initCertificates(CertificatesManager.java:295) ~[wechatpay-apache-httpclient-0.4.7.jar!/:0.4 at com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager.putMerchant(CertificatesManager.java:152) ~[wechatpay-apache-httpclient-0.4.7.jar!/

XingYu89757 commented 2 years ago

查看jdk使用版本

[参考连接](https://www.oracle.com/java/technologies/javase/8u161-relnotes.html)

Unlimited cryptography enabled by default

The JDK uses the Java Cryptography Extension (JCE) Jurisdiction Policy files to configure cryptographic algorithm restrictions. Previously, the Policy files in the JDK placed limits on various algorithms. This release ships with both the limited and unlimited jurisdiction policy files, with unlimited being the default. The behavior can be controlled via the new 'crypto.policy' Security property found in the /lib/java.security file. Please refer to that file for more information on this property.

See [[JDK-8170157](http://bugs.java.com/view_bug.do?bug_id=JDK-8170157)](http://bugs.java.com/view_bug.do?bug_id=JDK-8170157)