Class XAdESTimestampMessageDigestBuilder

java.lang.Object
eu.europa.esig.dss.xades.validation.timestamp.XAdESTimestampMessageDigestBuilder
All Implemented Interfaces:
TimestampMessageDigestBuilder

public class XAdESTimestampMessageDigestBuilder extends Object implements TimestampMessageDigestBuilder
Builds a message-imprint for XAdES timestamps
  • Constructor Details

    • XAdESTimestampMessageDigestBuilder

      public XAdESTimestampMessageDigestBuilder(XAdESSignature signature, DigestAlgorithm digestAlgorithm)
      Default constructor to be used for a new timestamp creation. This constructor requires certain properties to be provided for message-digest computation (see available setters).
      Parameters:
      signature - XAdESSignature containing timestamps to calculate message-imprint digest for
      digestAlgorithm - DigestAlgorithm to be used for message-imprint digest computation
    • XAdESTimestampMessageDigestBuilder

      public XAdESTimestampMessageDigestBuilder(XAdESSignature signature, TimestampToken timestampToken)
      Constructor to be used for existing timestamp message-imprint computation.
      Parameters:
      signature - XAdESSignature signature associated with the timestamp
      timestampToken - TimestampToken to compute message-digest for
  • Method Details

    • setCanonicalizationAlgorithm

      public void setCanonicalizationAlgorithm(String canonicalizationAlgorithm)
      Sets the canonicalization algorithm to be used for message-digest computation
      Parameters:
      canonicalizationAlgorithm - String
    • setEn319132

      public void setEn319132(boolean en319132)
      Sets whether the message-digest should be computed for a EN 319 132-1 standard timestamp token
      Parameters:
      en319132 - whether the timestamp is of EN 319 132-1 format
    • getContentTimestampMessageDigest

      public DSSMessageDigest getContentTimestampMessageDigest()
      Description copied from interface: TimestampMessageDigestBuilder
      Returns the content timestamp message-imprint digest (timestamped or to be).
      Specified by:
      getContentTimestampMessageDigest in interface TimestampMessageDigestBuilder
      Returns:
      DSSMessageDigest representing the message digest on canonicalized data to be timestamped
    • getAllDataObjectsTimestampMessageDigest

      protected DSSMessageDigest getAllDataObjectsTimestampMessageDigest()
      Returns the computed message-imprint digest for xades132:AllDataObjectsTimestamp token
      Returns:
      DSSMessageDigest message-imprint digest
    • getIndividualDataObjectsTimestampMessageDigest

      protected DSSMessageDigest getIndividualDataObjectsTimestampMessageDigest()
      Returns the computed message-imprint digest for xades132:IndividualDataObjectsTimestamp token
      Returns:
      DSSMessageDigest message-imprint digest
    • getSignatureTimestampMessageDigest

      public DSSMessageDigest getSignatureTimestampMessageDigest()
      Description copied from interface: TimestampMessageDigestBuilder
      Returns the message-imprint digest on data (signature value) that was timestamped by the SignatureTimeStamp for the given timestamp.
      Specified by:
      getSignatureTimestampMessageDigest in interface TimestampMessageDigestBuilder
      Returns:
      DSSMessageDigest representing the message-digest on canonicalized data to be timestamped
    • getTimestampX1MessageDigest

      public DSSMessageDigest getTimestampX1MessageDigest()
      Description copied from interface: TimestampMessageDigestBuilder
      Returns the message-imprint digest to be time-stamped. The data used to create digest contains the digital signature (XAdES example: ds:SignatureValue element), the signature time-stamp(s) present in the AdES-T form, the certification path references and the revocation status references.
      Specified by:
      getTimestampX1MessageDigest in interface TimestampMessageDigestBuilder
      Returns:
      DSSMessageDigest representing the message digest on canonicalized data to be timestamped
    • getTimestampX2MessageDigest

      public DSSMessageDigest getTimestampX2MessageDigest()
      Description copied from interface: TimestampMessageDigestBuilder
      Returns the data to be time-stamped which contains the concatenation of CompleteCertificateRefs and CompleteRevocationRefs elements (XAdES example).
      Specified by:
      getTimestampX2MessageDigest in interface TimestampMessageDigestBuilder
      Returns:
      DSSMessageDigest representing the message digest on canonicalized data to be timestamped
    • getArchiveTimestampMessageDigest

      public DSSMessageDigest getArchiveTimestampMessageDigest()
      Description copied from interface: TimestampMessageDigestBuilder
      Archive timestamp seals the data of the signature in a specific order. We need to retrieve the data for each timestamp.
      Specified by:
      getArchiveTimestampMessageDigest in interface TimestampMessageDigestBuilder
      Returns:
      DSSMessageDigest representing the message digest on canonicalized data to be timestamped