我想试试JDK 9,我需要JCE补丁。我在哪里能买到JCE zip file for JDK 9?或者我可以为JDK 8使用这个吗?我搜索了JDK 9的JCE,但是找不到它。提前谢谢。
发布于 2016-10-05 10:58:23
更新:Java6- 9的所有当前版本现在都启用了强加密技术。
我假设使用'JCE文件‘,您指的是"Java密码扩展(JCE)无限强管辖权策略文件“。
显然,在Java 9中,您不再需要拉链,参见:http://mail.openjdk.java.net/pipermail/security-dev/2016-October/014943.html
添加、‘Security.setProperty’(“crypto.policy”、“无限”)或编辑java.security配置文件将启用无限的强度。
其他详情:
使用代码设置属性的示例:
import javax.crypto.Cipher;
import java.security.Security;
class Test {
public static void main(String[] args) {
Security.setProperty("crypto.policy", "unlimited");
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES/CBC/PKCS5Padding");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
}
}
}结果:
Hello World!
2147483647
Press any key to continue . . .java -version:
Java(TM) SE Runtime Environment (build 9-ea+138)
Java HotSpot(TM) Server VM (build 9-ea+138, mixed mode)Alternatively,在JRE安装文件夹中编辑java.security配置文件:
https://stackoverflow.com/questions/39097058
复制相似问题