Class AbstractTokenProxy

java.lang.Object
eu.europa.esig.dss.diagnostic.AbstractTokenProxy
All Implemented Interfaces:
TokenProxy
Direct Known Subclasses:
AbstractSignatureWrapper, CertificateWrapper, RevocationWrapper

public abstract class AbstractTokenProxy extends Object implements TokenProxy
An abstract representation of a validation object
  • Constructor Details

    • AbstractTokenProxy

      protected AbstractTokenProxy()
      Default constructor
  • Method Details

    • getCurrentBasicSignature

      protected abstract XmlBasicSignature getCurrentBasicSignature()
      Returns a basic signature validation
      Returns:
      XmlBasicSignature
    • getCurrentCertificateChain

      protected abstract List<XmlChainItem> getCurrentCertificateChain()
      Returns the token's certificate chain
      Returns:
      a list of XmlChainItems
    • getCurrentSigningCertificate

      protected abstract XmlSigningCertificate getCurrentSigningCertificate()
      Returns the signing certificate of the token
      Returns:
      XmlSigningCertificate
    • foundCertificates

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

      public FoundRevocationsProxy foundRevocations()
      Description copied from interface: TokenProxy
      Returns FoundRevocationsProxy to access embedded revocation data
      Specified by:
      foundRevocations in interface TokenProxy
      Returns:
      FoundRevocationsProxy
    • 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
      Returns:
      a list of XmlDigestMatchers
    • getCertificateChain

      public List<CertificateWrapper> getCertificateChain()
      Description copied from interface: TokenProxy
      Returns the certificate chain
      Specified by:
      getCertificateChain in interface TokenProxy
      Returns:
      a list of CertificateWrapper representing the certificate chain
    • isSignatureIntact

      public boolean isSignatureIntact()
      Description copied from interface: TokenProxy
      Returns if the signatureValue of the token is valid against the identifier signing certificate's public key
      Specified by:
      isSignatureIntact in interface TokenProxy
      Returns:
      TRUE if the signatureValue is intact, FALSE otherwise
    • isSignatureValid

      public boolean isSignatureValid()
      Description copied from interface: TokenProxy
      Returns if the signature and all signed data is cryptographically correct
      Specified by:
      isSignatureValid in interface TokenProxy
      Returns:
      TRUE if the signature is cryptographically valid, FALSE otherwise
    • getSignatureAlgorithm

      public SignatureAlgorithm getSignatureAlgorithm()
      Description copied from interface: TokenProxy
      Returns the SignatureAlgorithm used to create the signatureValue
      Specified by:
      getSignatureAlgorithm in interface TokenProxy
      Returns:
      SignatureAlgorithm
    • getEncryptionAlgorithm

      public EncryptionAlgorithm getEncryptionAlgorithm()
      Description copied from interface: TokenProxy
      Returns the EncryptionAlgorithm used to create the signature
      Specified by:
      getEncryptionAlgorithm in interface TokenProxy
      Returns:
      EncryptionAlgorithm
    • getDigestAlgorithm

      public DigestAlgorithm getDigestAlgorithm()
      Description copied from interface: TokenProxy
      Returns the DigestAlgorithm used to create the signatureValue
      Specified by:
      getDigestAlgorithm in interface TokenProxy
      Returns:
      DigestAlgorithm
    • getKeyLengthUsedToSignThisToken

      public String getKeyLengthUsedToSignThisToken()
      Description copied from interface: TokenProxy
      Returns the length of the private key used to create the signatureValue of the token
      Specified by:
      getKeyLengthUsedToSignThisToken in interface TokenProxy
      Returns:
      {link String} key length
    • getSigningCertificate

      public CertificateWrapper getSigningCertificate()
      Description copied from interface: TokenProxy
      Returns the signing certificate of the token if identified
      Specified by:
      getSigningCertificate in interface TokenProxy
      Returns:
      CertificateWrapper
    • getSigningCertificatePublicKey

      public byte[] getSigningCertificatePublicKey()
      Description copied from interface: TokenProxy
      Returns the public key binaries linked to a private key used to create the signature, when a signing-certificate is not available.
      Specified by:
      getSigningCertificatePublicKey in interface TokenProxy
      Returns:
      public key of the signer
    • isSigningCertificateReferencePresent

      public boolean isSigningCertificateReferencePresent()
      Description copied from interface: TokenProxy
      Returns if a reference to the SigningCertificate is present within the token (used for signatures and timestamps)
      Specified by:
      isSigningCertificateReferencePresent in interface TokenProxy
      Returns:
      TRUE if a reference to the SigningCertificate is present, FALSE otherwise
    • isSigningCertificateReferenceUnique

      public boolean isSigningCertificateReferenceUnique()
      Description copied from interface: TokenProxy
      Returns if the reference to the signing certificate is unique and present only once
      Specified by:
      isSigningCertificateReferenceUnique in interface TokenProxy
      Returns:
      TRUE if the reference to the signing certificate is unique, FALSE otherwise
    • getSigningCertificateReference

      public CertificateRefWrapper getSigningCertificateReference()
      Description copied from interface: TokenProxy
      Returns the reference to the signing certificate present within the token (for signature or timestamp)
      Specified by:
      getSigningCertificateReference in interface TokenProxy
      Returns:
      CertificateRefWrapper reference to the signing certificate
    • getSigningCertificateReferences

      public List<CertificateRefWrapper> getSigningCertificateReferences()
      Description copied from interface: TokenProxy
      Returns a list of all references to the signing certificate present within the token (for signature or timestamp)
      Specified by:
      getSigningCertificateReferences in interface TokenProxy
      Returns:
      a list of CertificateRefWrapper references to the signing certificate
    • isTrustedChain

      public boolean isTrustedChain()
      Description copied from interface: TokenProxy
      Returns of the certificate chain is trusted
      Specified by:
      isTrustedChain in interface TokenProxy
      Returns:
      TRUE if the certificate chain is trusted, FALSE otherwise
    • isCertificateChainFromTrustedStore

      public boolean isCertificateChainFromTrustedStore()
      Checks if the certificate chain is trusted from a Trusted Store NOTE: Not from Trusted List!
      Returns:
      TRUE if a certificate chain is trusted from a trusted store, FALSE otherwise
    • getBinaries

      public abstract byte[] getBinaries()
      Returns binaries of the token, when present
      Returns:
      a byte array
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object