Skip to content

Instantly share code, notes, and snippets.

@adambarreiro
Last active March 16, 2022 10:48
Show Gist options
  • Save adambarreiro/a1ba786024bf01a3acd9fb89a960a720 to your computer and use it in GitHub Desktop.
Save adambarreiro/a1ba786024bf01a3acd9fb89a960a720 to your computer and use it in GitHub Desktop.
Tests whether JCE is installed or not
public class TestJCE {
public static void main(String[] args) {
try {
int maxKeyLen = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e) {
e.printStackTrace();
}
}
}
// Then run:
// javac TestJCE.java
// java -cp . TestJCE
// Returns 2147483647 if installed. Otherwise it is not installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment