首页 > 代码库 > java.security.InvalidKeyException: Illegal key size

java.security.InvalidKeyException: Illegal key size

 

首先去orical下载载无限制的jce版本,jdk1.8对应UnlimitedJCEPolicyJDK8。

然后用新的jar替换老$JAVA_HOME/lib/security下jar

 

Desktop cd /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/security/

security ls

US_export_policy.jar blacklisted.certs    java.policy          local_policy.jar

blacklist            cacerts              java.security        trusted.libraries

security sudo mv local_policy.jar local_policy.jar.bak

Password:

security sudo mv US_export_policy.jar US_export_policy.jar.bak

security sudo cp /Users/yinkw/Downloads/UnlimitedJCEPolicyJDK8/*.jar ./

security

 

 

--done--

java.security.InvalidKeyException: Illegal key size