Package com.helger.commons.system
Class CryptoPolicy
java.lang.Object
com.helger.commons.system.CryptoPolicy
Helper class to see if unlimited strength crypto is available. If it is not,
then symmetric encryption algorithms are restricted to 128-bit key size or
the encryption must provide key weakening or key escrow.
http://code.google.com/p/owasp-esapi-java/
This program attempts to generate a 256-bit AES key and use it to do to a simple encryption. If the encryption succeeds, the assumption is that the JVM being used has the "unlimited" strength JCE jurisdiction policy files installed.
We use this for JUnit tests. If unlimited strength crypto is not available, we simply skip certain JUnit tests that would require it.
Based on owasp-esapi-java source.http://code.google.com/p/owasp-esapi-java/
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck to see if unlimited strength crypto is available.
-
Method Details
-
isUnlimitedStrengthCryptoAvailable
public static boolean isUnlimitedStrengthCryptoAvailable()Check to see if unlimited strength crypto is available. There is an implicit assumption that the JCE jurisdiction policy files are not going to be changing while this given JVM is running.- Returns:
trueif we can provide keys longer than 128 bits,falseotherwise
-