When running Java source code to generate Token, if an exception "java.security.InvalidKeyException Key Size" appears, how to handle it?
2022-08-05
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:All
You can choose any of the following methods to handle it:
-
Upgrade Java to version 8u162 or above to use unlimited policy by default. If you upgrade to Java 9 or above, there are no related restrictions;
-
If your Java version is 8u151 or 8u152, please set unlimited permission policy directly in your program:
Security.setProperty("crypto.policy", "unlimited"); -
If your Java is another version, please download the JCE unlimited permission policy file from the official website and use the files in it to replace the corresponding jar in the $JAVA_HOME/lib/security directory:
- If you have installed JDK7, please visit Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 to download the file.
- If you have installed JDK8, please visit Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8 to download the file.
