Class CryptographicConstraintWrapper

java.lang.Object
eu.europa.esig.dss.validation.process.bbb.sav.checks.CryptographicConstraintWrapper

public class CryptographicConstraintWrapper extends Object
The wrapper for cryptographic information retrieved from a validation policy
  • Constructor Details

  • Method Details

    • isEncryptionAlgorithmReliable

      public boolean isEncryptionAlgorithmReliable(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm)
      Checks if the given EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      encryptionAlgorithm - EncryptionAlgorithm to check
      Returns:
      TRUE if the algorithm is reliable, FALSE otherwise
    • isDigestAlgorithmReliable

      public boolean isDigestAlgorithmReliable(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Checks if the given DigestAlgorithm is reliable (acceptable)
      Parameters:
      digestAlgorithm - DigestAlgorithm to 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} for EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      encryptionAlgorithm - EncryptionAlgorithm to check key length for
      keyLength - String the 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} for EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      encryptionAlgorithm - EncryptionAlgorithm to check key length for
      keySize - Integer the key length to be checked
      Returns:
      TRUE if the key length for the algorithm is reliable, FALSE otherwise
    • getExpirationDate

      public Date getExpirationDate(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, String keyLength)
      Gets an expiration date for the encryption algorithm with name algoToSearch and keyLength. Returns null if the expiration date is not defined for the algorithm.
      Parameters:
      encryptionAlgorithm - EncryptionAlgorithm to get expiration date for
      keyLength - String key length used to sign the token
      Returns:
      Date
    • getExpirationDate

      public Date getExpirationDate(eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm, Integer keySize)
      Gets an expiration date for the encryption algorithm with name algoToSearch and keyLength. Returns null if the expiration date is not defined for the algorithm.
      Parameters:
      encryptionAlgorithm - EncryptionAlgorithm to get expiration date for
      keySize - Integer key length used to sign the token
      Returns:
      Date
    • getExpirationDate

      public Date getExpirationDate(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Gets an expiration date for the digest algorithm with name digestAlgoToSearch. 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

      public List<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithms()
      This method returns a list of reliable DigestAlgorithm according to the current validation policy
      Returns:
      a list of DigestAlgorithms
    • getReliableDigestAlgorithmsAtTime

      public List<eu.europa.esig.dss.enumerations.DigestAlgorithm> getReliableDigestAlgorithmsAtTime(Date validationTime)
      This method returns a list of reliable DigestAlgorithm according to the current validation policy at the given validation time
      Parameters:
      validationTime - Date to verify against
      Returns:
      a list of DigestAlgorithms
    • getReliableEncryptionAlgorithms

      public List<eu.europa.esig.dss.enumerations.EncryptionAlgorithm> getReliableEncryptionAlgorithms()
      This method returns a list of reliable EncryptionAlgorithm according to the current validation policy
      Returns:
      a list of EncryptionAlgorithms
    • getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime

      public Map<eu.europa.esig.dss.enumerations.EncryptionAlgorithm,Integer> getReliableEncryptionAlgorithmsWithMinimalKeyLengthAtTime(Date validationTime)
      This method returns a map between reliable EncryptionAlgorithm 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 EncryptionAlgorithms or their minimal accepted key length
    • getLevel

      public Level getLevel()
      Returns the global validation level of the cryptographic constraints for the current token
      Returns:
      Level
    • getAcceptableEncryptionAlgoLevel

      public LevelConstraint getAcceptableEncryptionAlgoLevel()
      Returns a level constraint for AcceptableEncryptionAlgo constraint if present, the global getLevel otherwise.
      Returns:
      LevelConstraint
    • getMiniPublicKeySizeLevel

      public LevelConstraint getMiniPublicKeySizeLevel()
      Returns a level constraint for MiniPublicKeySize constraint if present, the global getLevel otherwise.
      Returns:
      LevelConstraint
    • getAcceptableDigestAlgoLevel

      public LevelConstraint getAcceptableDigestAlgoLevel()
      Returns a level constraint for AcceptableDigestAlgo constraint if present, the global getLevel otherwise.
      Returns:
      LevelConstraint
    • getAlgoExpirationDateLevel

      public LevelConstraint getAlgoExpirationDateLevel()
      Returns a level constraint for AlgoExpirationDate constraint if present, the global getLevel otherwise.
      Returns:
      LevelConstraint
    • getCryptographicSuiteUpdateDate

      public Date getCryptographicSuiteUpdateDate()
      Returns a date of the update of the cryptographic suites within the validation policy
      Returns:
      Date
    • getAlgoExpirationDateAfterUpdateLevel

      public Level getAlgoExpirationDateAfterUpdateLevel()
      Returns a level constraint for AlgoExpirationDate constraint if present, the global getLevel otherwise.
      Returns:
      Level
    • getConstraint

      public CryptographicConstraint getConstraint()
      Gets the constraint
      Returns:
      CryptographicConstraint