Module jpms_dss_validation
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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch.static DategetExpirationDate(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.static DategetExpirationDate(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.static List<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithmsAtTime(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, Date validationTime) This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation timestatic List<eu.europa.esig.dss.model.policy.EncryptionAlgorithmWithMinKeySize> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(eu.europa.esig.dss.model.policy.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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmWithKeySizeReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)static booleanisEncryptionAlgorithmWithKeySizeReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)
-
Method Details
-
isEncryptionAlgorithmReliable
public static boolean isEncryptionAlgorithmReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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. -
getExpirationDate
public static Date getExpirationDate(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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. -
getExpirationDate
public static Date getExpirationDate(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.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<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithmsAtTime(eu.europa.esig.dss.model.policy.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<eu.europa.esig.dss.model.policy.EncryptionAlgorithmWithMinKeySize> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(eu.europa.esig.dss.model.policy.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
-