If JCE is already installed, you should see on that the jar files ‘local_policy.jar’ and ‘US_export_policy.jar’ are on $JAVA_HOME/jre/lib/security/
But, we can test it:
import javax.crypto.Cipher;
import java.security.*;
import javax.crypto.*;
class TestJCE {
public static void main(String[] args) {
boolean JCESupported = false;
try {
KeyGenerator kgen = KeyGenerator.getInstance("AES", "SunJCE");
kgen.init(256);
JCESupported = true;
} catch (NoSuchAlgorithmException e) {
JCESupported = false;
} catch (NoSuchProviderException e) {
JCESupported = false;
}
System.out.println("JCE Supported=" + JCESupported);
}
}
To compile (assuming file name is TestJCE.java):
$ javac TestJCE.java
Previous command will create TestJCE.class output file.
To Interpreting and Running the program:
$ java TestJCE