Last active
March 16, 2022 10:48
-
-
Save adambarreiro/a1ba786024bf01a3acd9fb89a960a720 to your computer and use it in GitHub Desktop.
Tests whether JCE is installed or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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