--Environment - Red Hat Enterprise Linux Server release 6.3 (Santiago) - java version "1.7.0_79"
InvalidKeyException occurred when the process of compounding the parameters sent from other servers worked.
java.security.InvalidKeyException: Illegal key size or default parameters
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1011)
at javax.crypto.Cipher.implInit(Cipher.java:786)
at javax.crypto.Cipher.chooseProvider(Cipher.java:849)
at javax.crypto.Cipher.init(Cipher.java:1213)
at javax.crypto.Cipher.init(Cipher.java:1153)
...abridgement...
In Java, the standard library Cipher class allows you to work with AES ciphers without the use of third-party libraries. However, AES encryption seems to be subject to US export restrictions, and the standard can only handle keys up to 128 bits. AES 256 cryptography in the Java 9 era-Qiita
local_policy.jar
ʻUS_export_policy.jar`) in the unzipped directory to the server where it will be placed.local_policy.jar
ʻUS_export_policy.jar located in
{java installation directory} / jre / lib / security / `{java installation directory} / jre / lib / security /
#Transfer to the server where the jar is placed
$ scp -i /path/to/{Private key}.pem /path/to/zip/UnlimitedJCEPolicy/*.jar ponsuke@{server}:/home/ponsuke/
local_policy.jar 100% 2500 12.2KB/s 00:00
US_export_policy.jar 100% 2487 12.1KB/s 00:00
#Log in to the server
$ ssh -i /path/to/{Private key}.pem ponsuke@{server}
Last login: Thu May 14 20:56:50 2020 from 10.0.1.10
#Check the Java installation directory
$ printenv JAVA_HOME
/usr/java/default
#Back up the jar
$ cd $JAVA_HOME/jre/lib/security/
$ sudo mv local_policy.jar local_policy.jar.bak
[sudo] password for ponsuke:
$ sudo mv US_export_policy.jar US_export_policy.jar.bak
#Place the jar in the unzipped directory
$ sudo mv /home/ponsuke/*.jar .
$ ls -la | grep jar
-rw-r--r--1 ponsuke appl 2487 May 14 21:36 2020 US_export_policy.jar
-rw-r--r--.1 root root 2397 April 11 03:55 2015 US_export_policy.jar.bak
-rw-r--r--1 ponsuke appl 2500 May 14 21:36 2020 local_policy.jar
-rw-r--r--.1 root root 2865 April 11 03:55 2015 local_policy.jar.bak
Recommended Posts