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 Date
getExpirationDate
(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch
.static Date
getExpirationDate
(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearch
andkeyLength
.static Date
getExpirationDate
(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearch
andkeyLength
.static List
<DigestAlgorithm> getReliableDigestAlgorithmsAtTime
(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a list of reliableDigestAlgorithm
according to the current validation policy at the given validation timegetReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a map between reliableEncryptionAlgorithm
according to the current validation policy and their minimal accepted key length at the given time.static boolean
isDigestAlgorithmReliable
(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithm
is reliable (acceptable)static boolean
isEncryptionAlgorithmReliable
(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithm
is reliable (acceptable)static boolean
isEncryptionAlgorithmWithKeySizeReliable
(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)static boolean
isEncryptionAlgorithmWithKeySizeReliable
(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)
-
Method Details
-
isEncryptionAlgorithmReliable
public static boolean isEncryptionAlgorithmReliable(CryptographicSuite cryptographicSuite, EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithm
is reliable (acceptable)- Parameters:
cryptographicSuite
-CryptographicSuite
encryptionAlgorithm
-EncryptionAlgorithm
to check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isDigestAlgorithmReliable
public static boolean isDigestAlgorithmReliable(CryptographicSuite cryptographicSuite, DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithm
is reliable (acceptable)- Parameters:
cryptographicSuite
-CryptographicSuite
digestAlgorithm
-DigestAlgorithm
to 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} forEncryptionAlgorithm
is reliable (acceptable)- Parameters:
cryptographicSuite
-CryptographicSuite
encryptionAlgorithm
-EncryptionAlgorithm
to check key length forkeyLength
-String
the 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} forEncryptionAlgorithm
is reliable (acceptable)- Parameters:
cryptographicSuite
-CryptographicSuite
encryptionAlgorithm
-EncryptionAlgorithm
to check key length forkeySize
-Integer
the 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 namealgoToSearch
andkeyLength
. Returns null if the expiration date is not defined for the algorithm.- Parameters:
cryptographicSuite
-CryptographicSuite
encryptionAlgorithm
-EncryptionAlgorithm
to get expiration date forkeyLength
-String
key 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 namealgoToSearch
andkeyLength
. Returns null if the expiration date is not defined for the algorithm.- Parameters:
cryptographicSuite
-CryptographicSuite
encryptionAlgorithm
-EncryptionAlgorithm
to get expiration date forkeySize
-Integer
key 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
-CryptographicSuite
digestAlgorithm
-DigestAlgorithm
the algorithm to get expiration date for- Returns:
Date
-
getReliableDigestAlgorithmsAtTime
public static List<DigestAlgorithm> getReliableDigestAlgorithmsAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a list of reliableDigestAlgorithm
according to the current validation policy at the given validation time- Parameters:
cryptographicSuite
-CryptographicSuite
validationTime
-Date
to verify against- Returns:
- a list of
DigestAlgorithm
s
-
getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
public static List<EncryptionAlgorithmWithMinKeySize> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(CryptographicSuite cryptographicSuite, Date validationTime) This method returns a map between reliableEncryptionAlgorithm
according to the current validation policy and their minimal accepted key length at the given time.- Parameters:
cryptographicSuite
-CryptographicSuite
validationTime
-Date
to verify against- Returns:
- a list of
EncryptionAlgorithmWithMinKeySize
s
-