Monday, March 30, 2015

java.lang.SecurityException: Unsupported keysize or algorithm or java.security.InvalidKeyException: Illegal key size


I have faced this issue when working with the Bouncy Castle Provider and the reason for that is the JCE files are not updated in the JVM. To fix it, one needs to download the JCE unrestricted policy files from oracle site, e.g download and copy the local_policy.jar and the US_export_policy.jar to jre/lib/security. This fixes the issue

Got the solution from the Frequently asked questions for Bouncy Castle, here


No comments:

Post a Comment