Class SignatureAlgorithms

java.lang.Object
xades4j.production.SignatureAlgorithms

public final class SignatureAlgorithms extends Object
Configuration of the algorithms used for signature production.

The defaults are:

  • Signature: RSA(RSA_SHA256), DSA(DSA_SHA1), EC(ECDSA_SHA256)
  • Canonicalization: Canonical XML 1.0 without comments
  • Digest: SHA256
See Also:
  • Constructor Details

    • SignatureAlgorithms

      public SignatureAlgorithms()
  • Method Details

    • withSignatureAlgorithm

      public SignatureAlgorithms withSignatureAlgorithm(String keyAlgorithmName, String signatureAlgorithm)
      Set the signature algorithm to be used when the signing key has the given key algorithm.
      Parameters:
      keyAlgorithmName - the key's algorithm name as defined in JCA standard algorithm names
      signatureAlgorithm - the signature algorithm
      Returns:
      the current instance
    • withCanonicalizationAlgorithmForSignature

      public SignatureAlgorithms withCanonicalizationAlgorithmForSignature(Algorithm algorithm)
      Sets the canonicalization algorithm to be used in the Signature.
      Parameters:
      algorithm - the algorithm
      Returns:
      the current instance
    • withCanonicalizationAlgorithmForTimeStampProperties

      public SignatureAlgorithms withCanonicalizationAlgorithmForTimeStampProperties(Algorithm algorithm)
      Sets the canonicalization algorithm to be used in the qualifying properties that contain time-stamp tokens.
      Parameters:
      algorithm - the algorithm
      Returns:
      the current instance
    • withDigestAlgorithmForDataObjectReferences

      public SignatureAlgorithms withDigestAlgorithmForDataObjectReferences(String algorithm)
      Sets the digest algorithm to be used in the data object References.
      Parameters:
      algorithm - the algorithm
      Returns:
      the current instance
    • withDigestAlgorithmForReferenceProperties

      public SignatureAlgorithms withDigestAlgorithmForReferenceProperties(String algorithm)
      Sets the digest algorithm to be used in the qualifying properties that contain references to certificates, CRLs and so on.
      Parameters:
      algorithm - the algorithm
      Returns:
      the current instance
    • withDigestAlgorithmForTimeStampProperties

      public SignatureAlgorithms withDigestAlgorithmForTimeStampProperties(String algorithm)
      Sets the digest algorithm to be used in the qualifying properties that contain time-stamp tokens.
      Parameters:
      algorithm - the algorithm
      Returns:
      the current instance