Class CryptoPolicy


  • @ThreadSafe
    public final class CryptoPolicy
    extends Object
    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.

    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 Detail

      • 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:
        true if we can provide keys longer than 128 bits, false otherwise