Class CryptographicSuiteUtils
java.lang.Object
eu.europa.esig.dss.validation.policy.CryptographicSuiteUtils
This class contains supporting methods for processing a
eu.europa.esig.dss.model.policy.CryptographicSuite-
Method Summary
Modifier and TypeMethodDescriptionstatic DategetExpirationDate(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch.static DategetExpirationDate(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.static DategetExpirationDate(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.static List<DigestAlgorithm> getReliableDigestAlgorithmsAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation timegetReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a map between reliableEncryptionAlgorithmaccording to the current validation policy and their minimal accepted key length at the given time.static booleanisDigestAlgorithmReliable(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmWithKeySizeReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmWithKeySizeReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)
-
Method Details
-
isEncryptionAlgorithmReliable
public static boolean isEncryptionAlgorithmReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)- Parameters:
cryptographicSuite-CryptographicSuiteencryptionAlgorithm-EncryptionAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isDigestAlgorithmReliable
public static boolean isDigestAlgorithmReliable(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)- Parameters:
cryptographicSuite-CryptographicSuitedigestAlgorithm-DigestAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isEncryptionAlgorithmWithKeySizeReliable
public static boolean isEncryptionAlgorithmWithKeySizeReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)- Parameters:
cryptographicSuite-CryptographicSuiteencryptionAlgorithm-EncryptionAlgorithmto check key length forkeyLength-Stringthe key length to be checked- Returns:
- TRUE if the key length for the algorithm is reliable, FALSE otherwise
-
isEncryptionAlgorithmWithKeySizeReliable
public static boolean isEncryptionAlgorithmWithKeySizeReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)- Parameters:
cryptographicSuite-CryptographicSuiteencryptionAlgorithm-EncryptionAlgorithmto check key length forkeySize-Integerthe key length to be checked- Returns:
- TRUE if the key length for the algorithm is reliable, FALSE otherwise
-
getExpirationDate
public static Date getExpirationDate(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength. Returns null if the expiration date is not defined for the algorithm.- Parameters:
cryptographicSuite-CryptographicSuiteencryptionAlgorithm-EncryptionAlgorithmto get expiration date forkeyLength-Stringkey length used to sign the token- Returns:
Date
-
getExpirationDate
public static Date getExpirationDate(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength. Returns null if the expiration date is not defined for the algorithm.- Parameters:
cryptographicSuite-CryptographicSuiteencryptionAlgorithm-EncryptionAlgorithmto get expiration date forkeySize-Integerkey length used to sign the token- Returns:
Date
-
getExpirationDate
public static Date getExpirationDate(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch. Returns null if the expiration date is not defined for the algorithm.- Parameters:
cryptographicSuite-CryptographicSuitedigestAlgorithm-DigestAlgorithmthe algorithm to get expiration date for- Returns:
Date
-
getReliableDigestAlgorithmsAtTime
public static List<DigestAlgorithm> getReliableDigestAlgorithmsAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation time- Parameters:
cryptographicSuite-CryptographicSuitevalidationTime-Dateto verify against- Returns:
- a list of
DigestAlgorithms
-
getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
public static List<EncryptionAlgorithmWithMinKeySize> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a map between reliableEncryptionAlgorithmaccording to the current validation policy and their minimal accepted key length at the given time.- Parameters:
cryptographicSuite-CryptographicSuitevalidationTime-Dateto verify against- Returns:
- a list of
EncryptionAlgorithmWithMinKeySizes
-