报错提示
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)
AES生成128位加密参数时报错,原因是 jre\lib\security 目录下
local_policy.jar、US_export_policy.jar 这两个权限文件根据美国政府要求做了限制,
需要下载无限制权限文件
下载地址(JDK1.8):
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
下载解压后,替换%JDK_Home%\jre\lib\security 目录下的文件,就可以了。