Class CryptographicConstraintWrapper
java.lang.Object
eu.europa.esig.dss.validation.process.bbb.sav.checks.CryptographicConstraintWrapper
The wrapper for cryptographic information retrieved from a validation policy
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevelotherwise.Returns a level constraint for AcceptableEncryptionAlgo constraint if present, the globalgetLevelotherwise.Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.Gets the constraintReturns a date of the update of the cryptographic suites within the validation policygetExpirationDate(DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch.getExpirationDate(EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.getExpirationDate(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.getLevel()Returns the global validation level of the cryptographic constraints for the current tokenReturns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevelotherwise.This method returns a list of reliableDigestAlgorithmaccording to the current validation policygetReliableDigestAlgorithmsAtTime(Date validationTime) This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation timeThis method returns a list of reliableEncryptionAlgorithmaccording to the current validation policygetReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(Date validationTime) This method returns a map between reliableEncryptionAlgorithmaccording to the current validation policy and their minimal accepted key length at the given time.booleanisDigestAlgorithmReliable(DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmReliable(EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)
-
Constructor Details
-
CryptographicConstraintWrapper
Default constructor- Parameters:
constraint-CryptographicConstraint
-
-
Method Details
-
isEncryptionAlgorithmReliable
Checks if the givenEncryptionAlgorithmis reliable (acceptable)- Parameters:
encryptionAlgorithm-EncryptionAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isDigestAlgorithmReliable
Checks if the givenDigestAlgorithmis reliable (acceptable)- Parameters:
digestAlgorithm-DigestAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isEncryptionAlgorithmWithKeySizeReliable
public boolean isEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)- Parameters:
encryptionAlgorithm-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 boolean isEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)- Parameters:
encryptionAlgorithm-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
Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength. Returns null if the expiration date is not defined for the algorithm.- Parameters:
encryptionAlgorithm-EncryptionAlgorithmto get expiration date forkeyLength-Stringkey length used to sign the token- Returns:
Date
-
getExpirationDate
Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength. Returns null if the expiration date is not defined for the algorithm.- Parameters:
encryptionAlgorithm-EncryptionAlgorithmto get expiration date forkeySize-Integerkey length used to sign the token- Returns:
Date
-
getExpirationDate
Gets an expiration date for the digest algorithm with namedigestAlgoToSearch. Returns null if the expiration date is not defined for the algorithm.- Parameters:
digestAlgorithm-DigestAlgorithmthe algorithm to get expiration date for- Returns:
Date
-
getReliableDigestAlgorithms
This method returns a list of reliableDigestAlgorithmaccording to the current validation policy- Returns:
- a list of
DigestAlgorithms
-
getReliableDigestAlgorithmsAtTime
This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation time- Parameters:
validationTime-Dateto verify against- Returns:
- a list of
DigestAlgorithms
-
getReliableEncryptionAlgorithms
This method returns a list of reliableEncryptionAlgorithmaccording to the current validation policy- Returns:
- a list of
EncryptionAlgorithms
-
getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
public Map<EncryptionAlgorithm,Integer> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(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:
validationTime-Dateto verify against- Returns:
- a map of
EncryptionAlgorithms or their minimal accepted key length
-
getLevel
Returns the global validation level of the cryptographic constraints for the current token- Returns:
Level
-
getAcceptableEncryptionAlgoLevel
Returns a level constraint for AcceptableEncryptionAlgo constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getMiniPublicKeySizeLevel
Returns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getAcceptableDigestAlgoLevel
Returns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getAlgoExpirationDateLevel
Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getCryptographicSuiteUpdateDate
Returns a date of the update of the cryptographic suites within the validation policy- Returns:
Date
-
getAlgoExpirationDateAfterUpdateLevel
Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.- Returns:
Level
-
getConstraint
Gets the constraint- Returns:
CryptographicConstraint
-