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
ConstructorDescriptionDefault constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevel
otherwise.Returns a level constraint for AcceptableEncryptionAlgo constraint if present, the globalgetLevel
otherwise.Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevel
otherwise.Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevel
otherwise.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 namealgoToSearch
andkeyLength
.getExpirationDate
(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearch
andkeyLength
.getLevel()
Returns the global validation level of the cryptographic constraints for the current tokenReturns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevel
otherwise.This method returns a list of reliableDigestAlgorithm
according to the current validation policygetReliableDigestAlgorithmsAtTime
(Date validationTime) This method returns a list of reliableDigestAlgorithm
according to the current validation policy at the given validation timeThis method returns a list of reliableEncryptionAlgorithm
according to the current validation policygetReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
(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.boolean
isDigestAlgorithmReliable
(DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithm
is reliable (acceptable)boolean
isEncryptionAlgorithmReliable
(EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithm
is reliable (acceptable)boolean
isEncryptionAlgorithmWithKeySizeReliable
(EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)boolean
isEncryptionAlgorithmWithKeySizeReliable
(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)
-
Constructor Details
-
CryptographicConstraintWrapper
Default constructor- Parameters:
constraint
-CryptographicConstraint
-
-
Method Details
-
isEncryptionAlgorithmReliable
Checks if the givenEncryptionAlgorithm
is reliable (acceptable)- Parameters:
encryptionAlgorithm
-EncryptionAlgorithm
to check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isDigestAlgorithmReliable
Checks if the givenDigestAlgorithm
is reliable (acceptable)- Parameters:
digestAlgorithm
-DigestAlgorithm
to check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isEncryptionAlgorithmWithKeySizeReliable
public boolean isEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)- Parameters:
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 boolean isEncryptionAlgorithmWithKeySizeReliable(EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithm
is reliable (acceptable)- Parameters:
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
Gets an expiration date for the encryption algorithm with namealgoToSearch
andkeyLength
. Returns null if the expiration date is not defined for the algorithm.- Parameters:
encryptionAlgorithm
-EncryptionAlgorithm
to get expiration date forkeyLength
-String
key length used to sign the token- Returns:
Date
-
getExpirationDate
Gets an expiration date for the encryption algorithm with namealgoToSearch
andkeyLength
. Returns null if the expiration date is not defined for the algorithm.- Parameters:
encryptionAlgorithm
-EncryptionAlgorithm
to get expiration date forkeySize
-Integer
key 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
-DigestAlgorithm
the algorithm to get expiration date for- Returns:
Date
-
getReliableDigestAlgorithms
This method returns a list of reliableDigestAlgorithm
according to the current validation policy- Returns:
- a list of
DigestAlgorithm
s
-
getReliableDigestAlgorithmsAtTime
This method returns a list of reliableDigestAlgorithm
according to the current validation policy at the given validation time- Parameters:
validationTime
-Date
to verify against- Returns:
- a list of
DigestAlgorithm
s
-
getReliableEncryptionAlgorithms
This method returns a list of reliableEncryptionAlgorithm
according to the current validation policy- Returns:
- a list of
EncryptionAlgorithm
s
-
getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
public Map<EncryptionAlgorithm,Integer> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(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:
validationTime
-Date
to verify against- Returns:
- a map of
EncryptionAlgorithm
s 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 globalgetLevel
otherwise.- Returns:
LevelConstraint
-
getMiniPublicKeySizeLevel
Returns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevel
otherwise.- Returns:
LevelConstraint
-
getAcceptableDigestAlgoLevel
Returns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevel
otherwise.- Returns:
LevelConstraint
-
getAlgoExpirationDateLevel
Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevel
otherwise.- 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 globalgetLevel
otherwise.- Returns:
Level
-
getConstraint
Gets the constraint- Returns:
CryptographicConstraint
-