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
To programmatically handle this, The following code in Scala will help you do it. The code given above will not work for java version 8. You will get an error. Error : Can not set static final boolean field javax.crypto.JceSecurity.isRestricted to java.lang.Boolean
if (Cipher.getMaxAllowedKeyLength("AES") < 256) {
try {
var field=Class.forName("javax.crypto.JceSecurity").getDeclaredField("isRestricted")
field.setAccessible(true)
var modifiersField = classOf[Field].getDeclaredField( "modifiers" )
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(null, java.lang.Boolean.FALSE)
}
catch{
case ex:Exception=>throw ex
}
}