Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do I get “java.lang.SecurityException: Unsupported keysize or algorithm parameters” or “java.security.InvalidKeyException: Illegal key size” when I try using the Bouncy Castle Provider?

0
Posted

Why do I get “java.lang.SecurityException: Unsupported keysize or algorithm parameters” or “java.security.InvalidKeyException: Illegal key size” when I try using the Bouncy Castle Provider?

0

If you see this it means the unrestricted policy files for the JVM you are using have not been installed. You can find these at http://java.sun.com at the same place as you downloaded the JDK/JRE (they’re normally at the bottom of the page). Download the zip file Sun provide, follow the instructions, making sure you are installing the files into the JVM you are running with, and you should find the exception stops happening. Note: providing maximum key sizes are not exceeded it is possible to use the BC provider without getting this exception. If it suddenly starts happening the first thing to check is the policy files.

Related Questions

Thanksgiving questions

*Sadly, we had to bring back ads too. Hopefully more targeted.