Module jpms_dss_validation
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
ConstructorsConstructorDescriptionCryptographicConstraintWrapper(eu.europa.esig.dss.policy.jaxb.CryptographicConstraint constraint) Default constructor -
Method Summary
Modifier and TypeMethodDescriptioneu.europa.esig.dss.policy.jaxb.LevelConstraintReturns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevelotherwise.eu.europa.esig.dss.policy.jaxb.LevelConstraintReturns a level constraint for AcceptableEncryptionAlgo constraint if present, the globalgetLevelotherwise.eu.europa.esig.dss.policy.jaxb.LevelReturns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.eu.europa.esig.dss.policy.jaxb.LevelConstraintReturns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.eu.europa.esig.dss.policy.jaxb.CryptographicConstraintGets the constraintReturns a date of the update of the cryptographic suites within the validation policygetExpirationDate(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) Gets an expiration date for the digest algorithm with namedigestAlgoToSearch.getExpirationDate(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.getExpirationDate(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, String keyLength) Gets an expiration date for the encryption algorithm with namealgoToSearchandkeyLength.eu.europa.esig.dss.policy.jaxb.LevelgetLevel()Returns the global validation level of the cryptographic constraints for the current tokeneu.europa.esig.dss.policy.jaxb.LevelConstraintReturns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevelotherwise.List<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithmsAtTime(Date validationTime) This method returns a list of reliableDigestAlgorithmaccording to the current validation policy at the given validation timegetReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(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(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmReliable(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmWithKeySizeReliable(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, Integer keySize) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)booleanisEncryptionAlgorithmWithKeySizeReliable(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, String keyLength) Checks if the {code keyLength} forEncryptionAlgorithmis reliable (acceptable)
-
Constructor Details
-
CryptographicConstraintWrapper
public CryptographicConstraintWrapper(eu.europa.esig.dss.policy.jaxb.CryptographicConstraint constraint) Default constructor- Parameters:
constraint-CryptographicConstraint
-
-
Method Details
-
isEncryptionAlgorithmReliable
public boolean isEncryptionAlgorithmReliable(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm) Checks if the givenEncryptionAlgorithmis reliable (acceptable)- Parameters:
encryptionAlgorithm-EncryptionAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isDigestAlgorithmReliable
public boolean isDigestAlgorithmReliable(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) Checks if the givenDigestAlgorithmis reliable (acceptable)- Parameters:
digestAlgorithm-DigestAlgorithmto check- Returns:
- TRUE if the algorithm is reliable, FALSE otherwise
-
isEncryptionAlgorithmWithKeySizeReliable
public boolean isEncryptionAlgorithmWithKeySizeReliable(eu.europa.esig.dss.enumerations.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(eu.europa.esig.dss.enumerations.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
-
getExpirationDate
-
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
-
getReliableDigestAlgorithmsAtTime
public List<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithmsAtTime(Date validationTime) 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
-
getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime
public Map<eu.europa.esig.dss.enumerations.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
public eu.europa.esig.dss.policy.jaxb.Level getLevel()Returns the global validation level of the cryptographic constraints for the current token- Returns:
Level
-
getAcceptableEncryptionAlgoLevel
public eu.europa.esig.dss.policy.jaxb.LevelConstraint getAcceptableEncryptionAlgoLevel()Returns a level constraint for AcceptableEncryptionAlgo constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getMiniPublicKeySizeLevel
public eu.europa.esig.dss.policy.jaxb.LevelConstraint getMiniPublicKeySizeLevel()Returns a level constraint for MiniPublicKeySize constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getAcceptableDigestAlgoLevel
public eu.europa.esig.dss.policy.jaxb.LevelConstraint getAcceptableDigestAlgoLevel()Returns a level constraint for AcceptableDigestAlgo constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getAlgoExpirationDateLevel
public eu.europa.esig.dss.policy.jaxb.LevelConstraint getAlgoExpirationDateLevel()Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.- Returns:
LevelConstraint
-
getCryptographicSuiteUpdateDate
-
getAlgoExpirationDateAfterUpdateLevel
public eu.europa.esig.dss.policy.jaxb.Level getAlgoExpirationDateAfterUpdateLevel()Returns a level constraint for AlgoExpirationDate constraint if present, the globalgetLevelotherwise.- Returns:
Level
-
getConstraint
public eu.europa.esig.dss.policy.jaxb.CryptographicConstraint getConstraint()Gets the constraint- Returns:
CryptographicConstraint
-