Class TimestampWrapper

All Implemented Interfaces:
TokenProxy

public class TimestampWrapper extends AbstractSignatureWrapper
Provides a user-friendly interface for dealing with JAXB XmlTimestamp object
  • Constructor Details

    • TimestampWrapper

      public TimestampWrapper(XmlTimestamp timestamp)
      Default constructor
      Parameters:
      timestamp - XmlTimestamp
  • Method Details

    • getId

      public String getId()
      Description copied from interface: TokenProxy
      Returns the unique identifier of the object
      Returns:
      String id
    • getCurrentBasicSignature

      protected XmlBasicSignature getCurrentBasicSignature()
      Description copied from class: AbstractTokenProxy
      Returns a basic signature validation
      Specified by:
      getCurrentBasicSignature in class AbstractTokenProxy
      Returns:
      XmlBasicSignature
    • getCurrentCertificateChain

      protected List<XmlChainItem> getCurrentCertificateChain()
      Description copied from class: AbstractTokenProxy
      Returns the token's certificate chain
      Specified by:
      getCurrentCertificateChain in class AbstractTokenProxy
      Returns:
      a list of XmlChainItems
    • getCurrentSigningCertificate

      protected XmlSigningCertificate getCurrentSigningCertificate()
      Description copied from class: AbstractTokenProxy
      Returns the signing certificate of the token
      Specified by:
      getCurrentSigningCertificate in class AbstractTokenProxy
      Returns:
      XmlSigningCertificate
    • foundCertificates

      public FoundCertificatesProxy foundCertificates()
      Description copied from interface: TokenProxy
      Returns FoundCertificatesProxy to access embedded certificates
      Specified by:
      foundCertificates in interface TokenProxy
      Overrides:
      foundCertificates in class AbstractTokenProxy
      Returns:
      FoundCertificatesProxy
    • foundRevocations

      public FoundRevocationsProxy foundRevocations()
      Description copied from interface: TokenProxy
      Returns FoundRevocationsProxy to access embedded revocation data
      Specified by:
      foundRevocations in interface TokenProxy
      Overrides:
      foundRevocations in class AbstractTokenProxy
      Returns:
      FoundRevocationsProxy
    • getType

      public TimestampType getType()
      Returns the type of the timestamp
      Returns:
      TimestampType
    • getArchiveTimestampType

      public ArchiveTimestampType getArchiveTimestampType()
      Returns archive timestamp type, if applicable NOTE: returns null for non archive timestamps
      Returns:
      ArchiveTimestampType
    • getProductionTime

      public Date getProductionTime()
      Returns the indicated production time of the timestamp
      Returns:
      Date
    • getMessageImprint

      public XmlDigestMatcher getMessageImprint()
      Returns message-imprint XmlDigestMatcher
      Returns:
      XmlDigestMatcher
    • isMessageImprintDataFound

      public boolean isMessageImprintDataFound()
      Indicates if the message-imprint is found (all the required data for message-imprint computation is present)
      Returns:
      TRUE if the message-imprint data is found, FALSE otherwise
    • isMessageImprintDataIntact

      public boolean isMessageImprintDataIntact()
      Indicates if the message-imprint is intact (matches the computed message-imprint)
      Returns:
      TRUE if the message-imprint data is intact, FALSE otherwise
    • getFilename

      public String getFilename()
      Gets name of the timestamp file, when applicable
      Returns:
      String file name
    • getDigestMatchers

      public List<XmlDigestMatcher> getDigestMatchers()
      Description copied from interface: TokenProxy
      Returns a list of DigestMatchers used in the validation process for a signature or timestamp
      Specified by:
      getDigestMatchers in interface TokenProxy
      Overrides:
      getDigestMatchers in class AbstractTokenProxy
      Returns:
      a list of XmlDigestMatchers
    • getTimestampedObjects

      public List<XmlTimestampedObject> getTimestampedObjects()
      Returns a complete list of all XmlTimestampedObjects covered by the timestamp
      Returns:
      list of XmlTimestampedObjects
    • getTimestampedSignatures

      public List<SignatureWrapper> getTimestampedSignatures()
      Returns a list of SignatureWrappers covered be the current timestamp
      Returns:
      list of SignatureWrappers
    • getTimestampedCertificates

      public List<CertificateWrapper> getTimestampedCertificates()
      Returns a list of certificates covered be the current timestamp
      Returns:
      list of CertificateWrappers
    • getTimestampedRevocations

      public List<RevocationWrapper> getTimestampedRevocations()
      Returns a list of revocation data covered be the current timestamp
      Returns:
      list of RevocationWrappers
    • getTimestampedTimestamps

      public List<TimestampWrapper> getTimestampedTimestamps()
      Returns a list of timestamps covered be the current timestamp
      Returns:
      list of TimestampWrappers
    • getTimestampedSignedData

      public List<SignerDataWrapper> getTimestampedSignedData()
      Returns a list of Signed data covered be the current timestamp
      Returns:
      list of SignerDataWrappers
    • isSigningCertificateIdentified

      public boolean isSigningCertificateIdentified()
      Indicates if the signing certificate reference is present within the timestamp token and matches the actual signing certificate
      Returns:
      TRUE if the signing certificate is unambiguously identified, FALSE otherwise
    • getAllTimestampedOrphanTokens

      public List<OrphanTokenWrapper> getAllTimestampedOrphanTokens()
      Returns a list of all OrphanTokens
      Returns:
      list of OrphanTokenWrappers
    • getTimestampedOrphanCertificates

      public List<OrphanCertificateTokenWrapper> getTimestampedOrphanCertificates()
      Returns a list of OrphanCertificateTokens
      Returns:
      list of orphan certificates
    • getTimestampedOrphanRevocations

      public List<OrphanRevocationTokenWrapper> getTimestampedOrphanRevocations()
      Returns a list of OrphanRevocationTokens
      Returns:
      list of orphan revocations
    • getBinaries

      public byte[] getBinaries()
      Description copied from class: AbstractTokenProxy
      Returns binaries of the token, when present
      Specified by:
      getBinaries in class AbstractTokenProxy
      Returns:
      a byte array
    • getDigestAlgoAndValue

      public XmlDigestAlgoAndValue getDigestAlgoAndValue()
      Returns digest algorithm and value of the timestamp token binaries, when defined
      Returns:
      XmlDigestAlgoAndValue
    • getPDFRevision

      public PDFRevisionWrapper getPDFRevision()
      Returns a PAdES-specific PDF Revision info NOTE: applicable only for PDF Document Timestamp
      Specified by:
      getPDFRevision in class AbstractSignatureWrapper
      Returns:
      PDFRevisionWrapper
    • getSignatureInformationStore

      public List<XmlSignerInfo> getSignatureInformationStore()
      Returns a list if Signer Infos (Signer Information Store) from CAdES CMS Signed Data
      Returns:
      list of XmlSignerInfos
    • isTSAGeneralNamePresent

      public boolean isTSAGeneralNamePresent()
      Checks if the tsa field of TSTInfo is present
      Returns:
      TRUE if the TSTInfo.tsa is present, FALSE otherwise
    • getTSAGeneralNameValue

      public String getTSAGeneralNameValue()
      Get TSA General Name value
      Returns:
      String representing a TSTInfo.tsa field when present, null otherwise
    • isTSAGeneralNameMatch

      public boolean isTSAGeneralNameMatch()
      Checks if the content of TSTInfo.tsa field matches the timestamp's issuer distinguishing name, without taking order into account
      Returns:
      TRUE if the TSTInfo.tsa field value matches the timestamp's issuer name, FALSE otherwise
    • isTSAGeneralNameOrderMatch

      public boolean isTSAGeneralNameOrderMatch()
      Checks if the content and the order of TSTInfo.tsa field match the timestamp's issuer distinguishing name
      Returns:
      TRUE if the TSTInfo.tsa field value and order match the timestamp's issuer name, FALSE otherwise
    • getTimestampScopes

      public List<XmlSignatureScope> getTimestampScopes()
      Returns Timestamp's Signature Scopes
      Returns:
      a list of XmlSignatureScopes