Class CryptographicSuiteUtils

java.lang.Object
eu.europa.esig.dss.validation.policy.CryptographicSuiteUtils

public final class CryptographicSuiteUtils extends Object
This class contains supporting methods for processing a eu.europa.esig.dss.model.policy.CryptographicSuite
  • Method Summary

    Modifier and Type
    Method
    Description
    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 name digestAlgoToSearch.
    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 name algoToSearch and keyLength.
    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 name algoToSearch and keyLength.
    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 reliable DigestAlgorithm according to the current validation policy at the given validation time
    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 reliable EncryptionAlgorithm according to the current validation policy and their minimal accepted key length at the given time.
    static boolean
    isDigestAlgorithmReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
    Checks if the given DigestAlgorithm is reliable (acceptable)
    static boolean
    isEncryptionAlgorithmReliable(eu.europa.esig.dss.model.policy.CryptographicSuite cryptographicSuite, eu.europa.esig.dss.enumerations.EncryptionAlgorithm encryptionAlgorithm)
    Checks if the given EncryptionAlgorithm is reliable (acceptable)
    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} for EncryptionAlgorithm is reliable (acceptable)
    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} for EncryptionAlgorithm is reliable (acceptable)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 given EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      cryptographicSuite - CryptographicSuite
      encryptionAlgorithm - EncryptionAlgorithm to 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 given DigestAlgorithm is reliable (acceptable)
      Parameters:
      cryptographicSuite - CryptographicSuite
      digestAlgorithm - DigestAlgorithm to 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} for EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      cryptographicSuite - CryptographicSuite
      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 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} for EncryptionAlgorithm is reliable (acceptable)
      Parameters:
      cryptographicSuite - CryptographicSuite
      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 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 name algoToSearch and keyLength. Returns null if the expiration date is not defined for the algorithm.
      Parameters:
      cryptographicSuite - CryptographicSuite
      encryptionAlgorithm - EncryptionAlgorithm to get expiration date for
      keyLength - String key length used to sign the token
      Returns:
      Date
    • 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 name algoToSearch and keyLength. Returns null if the expiration date is not defined for the algorithm.
      Parameters:
      cryptographicSuite - CryptographicSuite
      encryptionAlgorithm - EncryptionAlgorithm to get expiration date for
      keySize - Integer key length used to sign the token
      Returns:
      Date
    • 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 name digestAlgoToSearch. Returns null if the expiration date is not defined for the algorithm.
      Parameters:
      cryptographicSuite - CryptographicSuite
      digestAlgorithm - DigestAlgorithm the 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 reliable DigestAlgorithm according to the current validation policy at the given validation time
      Parameters:
      cryptographicSuite - CryptographicSuite
      validationTime - Date to 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 reliable EncryptionAlgorithm according to the current validation policy and their minimal accepted key length at the given time.
      Parameters:
      cryptographicSuite - CryptographicSuite
      validationTime - Date to verify against
      Returns:
      a list of EncryptionAlgorithmWithMinKeySizes