Can someone explain to me how to install Unlimited Strength Jurisdiction Policy Files. I downloaded .jar files from Oracle website but I\'m having a problem with installing
You need to determine your Java home path (either via System.getenv("JAVA_HOME") from Java or $ echo $JAVA_HOME on the command line). It should be a path like the following:
C:\Program Files\Java\jre8 on Windows/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home on Mac OS X/usr/java/jdk1.8.0_101/bin/java on *nixYou then need to copy the US_export_policy.jar and local_policy.jar files you downloaded into the directory: and overwrite the existing files of the same name.
Updated 05/17/17
The following code (for demonstration purposes only) will instruct the JVM that it is allowed to use AES-256 bit encryption and corresponding TLS ciphers regardless of the policy files installed. It is not recommended to employ this method.
if (Cipher.getMaxAllowedKeyLength("AES") < 256) {
try {
Field field = Class.forName("javax.crypto.JceSecurity").
getDeclaredField("isRestricted");
field.setAccessible(true);
field.set(null, java.lang.Boolean.FALSE);
} catch (Exception e) {
fail("Could not override JCE cryptography strength policy setting");
fail(e.getMessage());
}
}