Package org.owasp.esapi.reference.crypto
Class CryptoPolicy
- java.lang.Object
-
- org.owasp.esapi.reference.crypto.CryptoPolicy
-
public class CryptoPolicy extends java.lang.ObjectHelper 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. Class copied from https://github.com/Crydust/owasp-esapi-onlyencryptedproperties due to problems finding a corresponding repo containing the jar. Original license is BSD Copyright (c) 2007, The OWASP Foundation
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisUnlimitedStrengthCryptoAvailable()Check to see if unlimited strength crypto is available.
-
-
-
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.
-
-