Skip to content

Instantly share code, notes, and snippets.

@MichaelF25
Created September 20, 2017 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelF25/a360d068780366c79d69ad3c92814fb4 to your computer and use it in GitHub Desktop.
Save MichaelF25/a360d068780366c79d69ad3c92814fb4 to your computer and use it in GitHub Desktop.
Check if JCE is installed in Java / JRE / JDK
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println("JCE installed: ".concat(String.valueOf(maxKeyLen >= 256)));
} catch (Exception e){
System.out.println(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment