Class SignatureTimestampSource<AS extends AdvancedSignature,SA extends SignatureAttribute>

java.lang.Object
eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
eu.europa.esig.dss.validation.timestamp.SignatureTimestampSource<AS,SA>
Type Parameters:
AS - AdvancedSignature implementation
SA - the corresponding SignatureAttribute
All Implemented Interfaces:
TimestampSource, Serializable
Direct Known Subclasses:
CAdESTimestampSource, JAdESTimestampSource, XAdESTimestampSource

public abstract class SignatureTimestampSource<AS extends AdvancedSignature,SA extends SignatureAttribute> extends AbstractTimestampSource implements TimestampSource
The timestamp source of a signature
See Also:
  • Field Details

    • signature

      protected final AS extends AdvancedSignature signature
      The signature is being validated
    • crlSource

      protected ListRevocationSource<CRL> crlSource
      CRL revocation source containing merged data from signature and timestamps
    • ocspSource

      protected ListRevocationSource<OCSP> ocspSource
      OCSP revocation source containing merged data from signature and timestamps
    • certificateSource

      protected ListCertificateSource certificateSource
      CertificateSource containing merged data from signature and timestamps
    • contentTimestamps

      protected transient List<TimestampToken> contentTimestamps
      Enclosed content timestamps.
    • signatureTimestamps

      protected transient List<TimestampToken> signatureTimestamps
      Enclosed signature timestamps.
    • sigAndRefsTimestamps

      protected transient List<TimestampToken> sigAndRefsTimestamps
      Enclosed SignAndRefs timestamps.
    • refsOnlyTimestamps

      protected transient List<TimestampToken> refsOnlyTimestamps
      Enclosed RefsOnly timestamps.
    • archiveTimestamps

      protected transient List<TimestampToken> archiveTimestamps
      This variable contains the list of enclosed archive signature timestamps.
    • detachedTimestamps

      protected transient List<TimestampToken> detachedTimestamps
      This variable contains the list of detached timestamp tokens (used in ASiC with CAdES).
    • embeddedEvidenceRecords

      protected transient List<EvidenceRecord> embeddedEvidenceRecords
      This variable contains the list of evidence records embedded to the signature document.
    • detachedEvidenceRecords

      protected transient List<EvidenceRecord> detachedEvidenceRecords
      This variable contains the list of evidence records detached from the signature document.
    • unsignedPropertiesReferences

      protected transient List<TimestampedReference> unsignedPropertiesReferences
      A list of all TimestampedReferences extracted from a signature
  • Constructor Details

    • SignatureTimestampSource

      protected SignatureTimestampSource(AS signature)
      Default constructor
      Parameters:
      signature - AdvancedSignature is being validated
  • Method Details

    • getContentTimestamps

      public List<TimestampToken> getContentTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of incorporated content timestamps
      Specified by:
      getContentTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getSignatureTimestamps

      public List<TimestampToken> getSignatureTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of incorporated signature timestamps
      Specified by:
      getSignatureTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getTimestampsX1

      public List<TimestampToken> getTimestampsX1()
      Description copied from interface: TimestampSource
      Returns a list of incorporated SigAndRefs timestamps
      Specified by:
      getTimestampsX1 in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getTimestampsX2

      public List<TimestampToken> getTimestampsX2()
      Description copied from interface: TimestampSource
      Returns a list of incorporated RefsOnly timestamps
      Specified by:
      getTimestampsX2 in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getArchiveTimestamps

      public List<TimestampToken> getArchiveTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of incorporated archive timestamps
      Specified by:
      getArchiveTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getDocumentTimestamps

      public List<TimestampToken> getDocumentTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of incorporated document timestamps (PAdES only)
      Specified by:
      getDocumentTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getDetachedTimestamps

      public List<TimestampToken> getDetachedTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of detached timestamps (used in ASiC with CAdES)
      Specified by:
      getDetachedTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getAllTimestamps

      public List<TimestampToken> getAllTimestamps()
      Description copied from interface: TimestampSource
      Returns a list of all incorporated timestamps
      Specified by:
      getAllTimestamps in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getEmbeddedEvidenceRecords

      public List<EvidenceRecord> getEmbeddedEvidenceRecords()
      Description copied from interface: TimestampSource
      Returns a list of evidence records embedded to a signature document
      Specified by:
      getEmbeddedEvidenceRecords in interface TimestampSource
      Returns:
      a list of EvidenceRecords
    • getDetachedEvidenceRecords

      public List<EvidenceRecord> getDetachedEvidenceRecords()
      Description copied from interface: TimestampSource
      Returns a list of evidence records detached from a signature document
      Specified by:
      getDetachedEvidenceRecords in interface TimestampSource
      Returns:
      a list of EvidenceRecords
    • getAllEvidenceRecords

      public List<EvidenceRecord> getAllEvidenceRecords()
      Description copied from interface: TimestampSource
      Returns a list of all evidence records associated with the signature
      Specified by:
      getAllEvidenceRecords in interface TimestampSource
      Returns:
      a list of EvidenceRecords
    • getTimestampCertificateSources

      public ListCertificateSource getTimestampCertificateSources()
      Description copied from interface: TimestampSource
      Returns a merged ListCertificateSource of all embedded timestamp certificate sources
      Specified by:
      getTimestampCertificateSources in interface TimestampSource
      Returns:
      ListCertificateSource
    • getTimestampCertificateSourcesExceptLastArchiveTimestamp

      public ListCertificateSource getTimestampCertificateSourcesExceptLastArchiveTimestamp()
      Description copied from interface: TimestampSource
      Returns a merged ListCertificateSource of all embedded timestamp certificate sources except the latest Archive Timestamp
      Specified by:
      getTimestampCertificateSourcesExceptLastArchiveTimestamp in interface TimestampSource
      Returns:
      ListCertificateSource
    • getAllTimestampsExceptLastArchiveTimestamp

      public List<TimestampToken> getAllTimestampsExceptLastArchiveTimestamp()
      Description copied from interface: TimestampSource
      Returns a list of all TimestampTokens except the last archive timestamp
      Specified by:
      getAllTimestampsExceptLastArchiveTimestamp in interface TimestampSource
      Returns:
      a list of TimestampTokens
    • getTimestampCRLSources

      public ListRevocationSource<CRL> getTimestampCRLSources()
      Description copied from interface: TimestampSource
      Returns a merged ListRevocationSource of all embedded timestamp CRL sources
      Specified by:
      getTimestampCRLSources in interface TimestampSource
      Returns:
      ListRevocationSource
    • getTimestampOCSPSources

      public ListRevocationSource<OCSP> getTimestampOCSPSources()
      Description copied from interface: TimestampSource
      Returns a merged ListRevocationSource of all embedded timestamp OCSP sources
      Specified by:
      getTimestampOCSPSources in interface TimestampSource
      Returns:
      ListRevocationSource
    • getUnsignedPropertiesReferences

      public List<TimestampedReference> getUnsignedPropertiesReferences()
      Description copied from interface: TimestampSource
      Returns a list of TimestampedReferences for all tokens embedded into unsigned properties of the signature
      Specified by:
      getUnsignedPropertiesReferences in interface TimestampSource
      Returns:
      a list of TimestampedReferences
    • createAndValidate

      protected void createAndValidate()
      Creates and validates all timestamps Must be called only once
    • addExternalTimestamp

      public void addExternalTimestamp(TimestampToken timestamp)
      Description copied from interface: TimestampSource
      This method allows to add an external timestamp. The given timestamp must be processed before.
      Specified by:
      addExternalTimestamp in interface TimestampSource
      Parameters:
      timestamp - TimestampToken the timestamp token
    • addExternalEvidenceRecord

      public void addExternalEvidenceRecord(EvidenceRecord evidenceRecord)
      Description copied from interface: TimestampSource
      This method allows to add an external evidence record. The given evidence record must be processed before.
      Specified by:
      addExternalEvidenceRecord in interface TimestampSource
      Parameters:
      evidenceRecord - EvidenceRecord the evidence record covering the signature file
    • makeTimestampTokens

      protected void makeTimestampTokens()
      Populates all the lists by data found into the signature
    • makeTimestampTokensFromSignedAttributes

      protected void makeTimestampTokensFromSignedAttributes()
      Creates TimestampTokens from all instances extracted from signed attributes (content TSTs)
    • makeTimestampTokensFromUnsignedAttributes

      protected void makeTimestampTokensFromUnsignedAttributes()
      Creates TimestampTokens from found instances in unsigned properties
    • getSignedSignatureProperties

      protected SignatureProperties<SA> getSignedSignatureProperties()
      Returns the 'signed-signature-properties' element of the signature
      Returns:
      SignatureProperties
    • buildSignedSignatureProperties

      protected abstract SignatureProperties<SA> buildSignedSignatureProperties()
      Creates the 'signed-signature-properties' element of the signature
      Returns:
      SignatureProperties
    • getUnsignedSignatureProperties

      protected SignatureProperties<SA> getUnsignedSignatureProperties()
      Returns the 'unsigned-signature-properties' element of the signature
      Returns:
      SignatureProperties
    • buildUnsignedSignatureProperties

      protected abstract SignatureProperties<SA> buildUnsignedSignatureProperties()
      Creates the 'unsigned-signature-properties' element of the signature
      Returns:
      SignatureProperties
    • isContentTimestamp

      protected abstract boolean isContentTimestamp(SA signedAttribute)
      Determines if the given signedAttribute is an instance of "content-timestamp" element NOTE: Applicable only for CAdES
      Parameters:
      signedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Data Objects Timestamp, FALSE otherwise
    • isAllDataObjectsTimestamp

      protected abstract boolean isAllDataObjectsTimestamp(SA signedAttribute)
      Determines if the given signedAttribute is an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdES
      Parameters:
      signedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Data Objects Timestamp, FALSE otherwise
    • isIndividualDataObjectsTimestamp

      protected abstract boolean isIndividualDataObjectsTimestamp(SA signedAttribute)
      Determines if the given signedAttribute is an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdES
      Parameters:
      signedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Data Objects Timestamp, FALSE otherwise
    • isSignatureTimestamp

      protected abstract boolean isSignatureTimestamp(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "signature-timestamp" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Signature Timestamp, FALSE otherwise
    • isCompleteCertificateRef

      protected abstract boolean isCompleteCertificateRef(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "complete-certificate-ref" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Complete Certificate Ref, FALSE otherwise
    • isAttributeCertificateRef

      protected abstract boolean isAttributeCertificateRef(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "attribute-certificate-ref" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is an Attribute Certificate Ref, FALSE otherwise
    • isCompleteRevocationRef

      protected abstract boolean isCompleteRevocationRef(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "complete-revocation-ref" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Complete Revocation Ref, FALSE otherwise
    • isAttributeRevocationRef

      protected abstract boolean isAttributeRevocationRef(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "attribute-revocation-ref" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is an Attribute Revocation Ref, FALSE otherwise
    • isRefsOnlyTimestamp

      protected abstract boolean isRefsOnlyTimestamp(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "refs-only-timestamp" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Refs Only TimeStamp, FALSE otherwise
    • isSigAndRefsTimestamp

      protected abstract boolean isSigAndRefsTimestamp(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "sig-and-refs-timestamp" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Sig And Refs TimeStamp, FALSE otherwise
    • isCertificateValues

      protected abstract boolean isCertificateValues(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "certificate-values" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Certificate Values, FALSE otherwise
    • isRevocationValues

      protected abstract boolean isRevocationValues(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "revocation-values" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is a Revocation Values, FALSE otherwise
    • isAttrAuthoritiesCertValues

      protected abstract boolean isAttrAuthoritiesCertValues(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "AttrAuthoritiesCertValues" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is an AttrAuthoritiesCertValues, FALSE otherwise
    • isAttributeRevocationValues

      protected abstract boolean isAttributeRevocationValues(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "AttributeRevocationValues" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is an AttributeRevocationValues, FALSE otherwise
    • isArchiveTimestamp

      protected abstract boolean isArchiveTimestamp(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "archive-timestamp" element
      Parameters:
      unsignedAttribute - SignatureAttribute to process
      Returns:
      TRUE if the unsignedAttribute is an Archive TimeStamp, FALSE otherwise
    • isTimeStampValidationData

      protected abstract boolean isTimeStampValidationData(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "timestamp-validation-data" element
      Parameters:
      unsignedAttribute - SignatureTimestampSource to process
      Returns:
      TRUE if the unsignedAttribute is a TimeStamp Validation Data, FALSE otherwise
    • isCounterSignature

      protected abstract boolean isCounterSignature(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "counter-signature" element
      Parameters:
      unsignedAttribute - SignatureTimestampSource to process
      Returns:
      TRUE if the unsignedAttribute is a Counter signature, FALSE otherwise
    • isSignaturePolicyStore

      protected abstract boolean isSignaturePolicyStore(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "signature-policy-store" element
      Parameters:
      unsignedAttribute - SignatureTimestampSource to process
      Returns:
      TRUE if the unsignedAttribute is a Counter signature, FALSE otherwise
    • isEvidenceRecord

      protected abstract boolean isEvidenceRecord(SA unsignedAttribute)
      Determines if the given unsignedAttribute is an instance of "evidence-record" element
      Parameters:
      unsignedAttribute - SignatureTimestampSource to process
      Returns:
      TRUE if the unsignedAttribute is an evidence record, FALSE otherwise
    • makeTimestampToken

      protected abstract TimestampToken makeTimestampToken(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references)
      Creates a timestamp token from the provided signatureAttribute
      Parameters:
      signatureAttribute - SignatureAttribute to create timestamp from
      timestampType - a target TimestampType
      references - list of TimestampedReferences covered by the current timestamp
      Returns:
      TimestampToken
    • makeTimestampTokens

      protected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType)
      Creates timestamp tokens from the provided signatureAttribute
      Parameters:
      signatureAttribute - SignatureAttribute to create timestamp from
      timestampType - a target TimestampType
      Returns:
      a list of TimestampTokens
    • makeTimestampTokens

      protected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references)
      Creates timestamp tokens from the provided signatureAttribute with a given list of TimestampedReferences
      Parameters:
      signatureAttribute - SignatureAttribute to create timestamp from
      timestampType - a target TimestampType
      references - list of TimestampedReferences covered by the current timestamp
      Returns:
      a list of TimestampTokens
    • makeEvidenceRecords

      protected abstract List<EvidenceRecord> makeEvidenceRecords(SA signatureAttribute, List<TimestampedReference> references)
      Creates a list of evidence records from the provided signatureAttribute
      Parameters:
      signatureAttribute - SignatureAttribute to create evidence records from
      references - list of TimestampedReferences covered by the current evidence record(s)
      Returns:
      a list of EvidenceRecords
    • getSignerDataReferences

      public List<TimestampedReference> getSignerDataReferences()
      Description copied from interface: TimestampSource
      Returns a list of TimestampedReferences obtained from the signatureScopes
      Specified by:
      getSignerDataReferences in interface TimestampSource
      Returns:
      list of TimestampedReferences
    • getSignatureTimestampReferences

      protected List<TimestampedReference> getSignatureTimestampReferences()
      Returns a list of TimestampedReference for a "signature-timestamp" element
      Returns:
      list of TimestampedReferences
    • getSignatureReference

      protected TimestampedReference getSignatureReference()
      Creates a timestamped reference for the current signature
      Returns:
      TimestampedReference
    • getEncapsulatedReferencesFromTimestamps

      protected List<TimestampedReference> getEncapsulatedReferencesFromTimestamps(List<TimestampToken> timestampTokens)
      Returns a list of TimestampedReferences for tokens encapsulated within the list of timestampTokens
      Parameters:
      timestampTokens - a list of TimestampToken to get references from
      Returns:
      a list of TimestampedReferences
    • getSigningCertificateTimestampReferences

      protected List<TimestampedReference> getSigningCertificateTimestampReferences()
      Returns a list of TimestampedReferences created from signing certificates of the signature
      Returns:
      list of TimestampedReferences
    • getKeyInfoReferences

      protected List<TimestampedReference> getKeyInfoReferences()
      Returns references from the KeyInfo (for XAdES) encapsulated elements
      Returns:
      list of TimestampedReferences
    • getTimestampedCertificateRefs

      protected List<TimestampedReference> getTimestampedCertificateRefs(SA unsignedAttribute)
      Returns a list of TimestampedReference certificate refs found in the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to find references from
      Returns:
      list of TimestampedReferences
    • getCertificateRefs

      protected abstract List<CertificateRef> getCertificateRefs(SA unsignedAttribute)
      Returns a list of CertificateRefs from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get certRefs from
      Returns:
      list of CertificateRefs
    • getTimestampedRevocationRefs

      protected List<TimestampedReference> getTimestampedRevocationRefs(SA unsignedAttribute)
      Returns a list of TimestampedReference revocation refs found in the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to find references from
      Returns:
      list of TimestampedReferences
    • getCRLRefs

      protected abstract List<CRLRef> getCRLRefs(SA unsignedAttribute)
      Returns a list of CRL revocation refs from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get CRLRef
      Returns:
      list of CRLRefs
    • getOCSPRefs

      protected abstract List<OCSPRef> getOCSPRefs(SA unsignedAttribute)
      Returns a list of OCSP revocation refs from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get OCSPRefs from
      Returns:
      list of OCSPRefs
    • getTimestampedCertificateValues

      protected List<TimestampedReference> getTimestampedCertificateValues(SA unsignedAttribute)
      Returns a list of TimestampedReferences from the unsignedAttribute containing certificate values
      Parameters:
      unsignedAttribute - SignatureTimestampSource to extract certificate values from
      Returns:
      a list of TimestampedReferences
    • getEncapsulatedCertificateIdentifiers

      protected abstract List<Identifier> getEncapsulatedCertificateIdentifiers(SA unsignedAttribute)
      Returns a list of Identifiers obtained from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get certificate identifiers from
      Returns:
      list of Identifiers
    • getTimestampedRevocationValues

      protected List<TimestampedReference> getTimestampedRevocationValues(SA unsignedAttribute)
      Returns a list of timestamped revocation references extracted from the given unsigned attribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource containing revocation data
      Returns:
      a list of TimestampedReferences
    • getEncapsulatedCRLIdentifiers

      protected abstract List<CRLBinary> getEncapsulatedCRLIdentifiers(SA unsignedAttribute)
      Returns a list of CRLBinarys obtained from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get CRL identifiers from
      Returns:
      list of CRLBinarys
    • getEncapsulatedOCSPIdentifiers

      protected abstract List<OCSPResponseBinary> getEncapsulatedOCSPIdentifiers(SA unsignedAttribute)
      Returns a list of OCSPResponseBinarys obtained from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get OCSP identifiers from
      Returns:
      list of OCSPResponseBinarys
    • incorporateArchiveTimestampReferences

      protected void incorporateArchiveTimestampReferences(TimestampToken timestampToken, List<TimestampToken> previousTimestamps)
      The method incorporates all the timestamped references for the given archive timestampToken
      Parameters:
      timestampToken - TimestampToken representing an Archive TST to add references into
      previousTimestamps - a list of previously created TimestampTokens
    • getArchiveTimestampReferences

      protected List<TimestampedReference> getArchiveTimestampReferences(List<TimestampToken> previousTimestamps)
      Returns a list of time-stamped references for an archival time-stamp
      Parameters:
      previousTimestamps - a list of previous TimestampTokens
      Returns:
      a list of TimestampedReferences
    • getSignatureSignedDataReferences

      protected List<TimestampedReference> getSignatureSignedDataReferences()
      Returns a list of all TimestampedReferences found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdES
      Returns:
      list of TimestampedReferences
    • getTimestampValidationData

      protected List<TimestampedReference> getTimestampValidationData(SA unsignedAttribute)
      Returns a list of TimestampedReferences encapsulated to the "timestamp-validation-data" unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get timestamped references from
      Returns:
      list of TimestampedReferences
    • getCounterSignaturesReferences

      protected List<TimestampedReference> getCounterSignaturesReferences(List<AdvancedSignature> counterSignatures)
      Returns a list of TimestampedReferences encapsulated from the list of counter signatures
      Parameters:
      counterSignatures - a list of AdvancedSignature to get timestamped references from
      Returns:
      list of TimestampedReferences
    • getCounterSignatureReferences

      protected List<TimestampedReference> getCounterSignatureReferences(AdvancedSignature counterSignature)
      Returns a list of references extracted from a counter signature
      Parameters:
      counterSignature - AdvancedSignature representing a counter signature
      Returns:
      a list of TimestampedReferences
    • getCounterSignatures

      protected abstract List<AdvancedSignature> getCounterSignatures(SA unsignedAttribute)
      Extracts Counter Signatures from the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource containing counter signatures
      Returns:
      a list of AdvancedSignature containing counter signatures
    • getArchiveTimestampType

      protected abstract ArchiveTimestampType getArchiveTimestampType(SA unsignedAttribute)
      Returns ArchiveTimestampType for the given unsignedAttribute
      Parameters:
      unsignedAttribute - SignatureTimestampSource to get archive timestamp type for
      Returns:
      ArchiveTimestampType
    • validateTimestamps

      protected void validateTimestamps()
      Validates list of all timestamps present in the source
    • getTimestampMessageImprintDigestBuilder

      protected abstract TimestampMessageDigestBuilder getTimestampMessageImprintDigestBuilder(DigestAlgorithm digestAlgorithm)
      Returns a TimestampMessageDigestBuilder to compute message digest with the provided DigestAlgorithm
      Parameters:
      digestAlgorithm - DigestAlgorithm to use for message-digest computation
      Returns:
      TimestampMessageDigestBuilder
    • getTimestampMessageImprintDigestBuilder

      protected abstract TimestampMessageDigestBuilder getTimestampMessageImprintDigestBuilder(TimestampToken timestampToken)
      Parameters:
      timestampToken - TimestampToken to get message-imprint digest builder for
      Returns:
      TimestampMessageDigestBuilder
    • getTimestampScopes

      protected List<SignatureScope> getTimestampScopes(TimestampToken timestampToken)
      Generates timestamp token scopes
      Parameters:
      timestampToken - TimestampToken to get timestamp sources for
      Returns:
      a list of SignatureScopes
    • populateSources

      protected void populateSources(List<TimestampToken> timestampTokens)
      Allows to populate all merged sources with extracted from a timestamp data
      Parameters:
      timestampTokens - a list of TimestampTokens to populate data from
    • populateSources

      protected void populateSources(TimestampToken timestampToken)
      Allows to populate all merged sources with extracted from a timestamp data
      Parameters:
      timestampToken - TimestampToken to populate data from
    • populateSources

      protected void populateSources(EvidenceRecord externalEvidenceRecord)
      Allows to populate all sources from an external evidence record
      Parameters:
      externalEvidenceRecord - EvidenceRecord to populate data from
    • isTimestamped

      public boolean isTimestamped(String tokenId, TimestampedObjectType objectType)
      Description copied from interface: TimestampSource
      Checks if a tokenId with the given Id is covered by the timestamp source
      Specified by:
      isTimestamped in interface TimestampSource
      Parameters:
      tokenId - String Id of the token to check
      objectType - TimestampedObjectType defining the type of the token
      Returns:
      TRUE if the token if covered by the timestamp source, FALSE otherwise
    • getAttributeOrder

      protected Integer getAttributeOrder(SA signatureAttribute)
      Gets position of the signatureAttribute either within signed or unsigned properties
      Parameters:
      signatureAttribute - SignatureAttribute to search for
      Returns:
      position of the attribute within properties, NULL if not found