NutzCN Logo
问答 JDK1.8 微信java.security.InvalidKeyException:illegal Key Size 问题
发布于 3012天前 作者 sunhai1988 5656 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

根据官方下载:

策略文件(请到官网下载对应的版本, 例如JDK7的下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html 下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt,如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件;如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件

覆盖文件后,使用了 source /etc/profile 重启了 nutzwk 微信收到消息后还是提示 illegal Key Size

6 回复

100%是没有覆盖对.

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 org.nutz.weixin.repo.com.qq.weixin.mp.aes.WXBizMsgCrypt.decrypt(WXBizMsgCrypt.java:160)
        at org.nutz.weixin.repo.com.qq.weixin.mp.aes.WXBizMsgCrypt.decryptMsg(WXBizMsgCrypt.java:264)
        at org.nutz.weixin.util.Wxs.handle(Wxs.java:617)
        at cn.wizzer.modules.open.wx.WeixinController.msgIn(WeixinController.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at cn.wizzer.common.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at cn.wizzer.common.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
        at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
        at cn.wizzer.common.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:37)

@wendal declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="100"
declare -x HOME="/root"
declare -x HOSTNAME="*"
declare -x JAVA_HOME="/usr/java/default"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"

find / -name local_policy.jar
find / -name US_export_policy.jar

找出所有local_policy.jar,覆盖之.

不知道为啥 重新覆盖就好了。 。 谢谢

还有个比较有用的帖子:http://www.javacirecep.com/java-security/java-java-security-invalidkeyexception-illegal-key-size-or-default-parameters/

添加回复
请先登陆
回到顶部