Class TokenCertificateSource

java.lang.Object
eu.europa.esig.dss.spi.x509.CommonCertificateSource
eu.europa.esig.dss.spi.x509.TokenCertificateSource
All Implemented Interfaces:
CertificateSource, Serializable
Direct Known Subclasses:
RevocationCertificateSource

public abstract class TokenCertificateSource extends CommonCertificateSource
Represents a source of certificates embedded in a token (signature, timestamp, ocsp response)
See Also:
  • Constructor Details

    • TokenCertificateSource

      protected TokenCertificateSource()
      Default constructor
  • Method Details

    • addCertificateIdentifier

      protected void addCertificateIdentifier(SignerIdentifier signerIdentifier, eu.europa.esig.dss.enumerations.CertificateOrigin origin)
      Adds a CertificateIdentifier with its origin
      Parameters:
      signerIdentifier - the certificate identifier to be added
      origin - the origin of the certificate identifier
    • addCertificate

      protected void addCertificate(CertificateToken certificate, eu.europa.esig.dss.enumerations.CertificateOrigin origin)
      Adds a CertificateToken with its CertificateOrigin
      Parameters:
      certificate - the certificate to be added
      origin - the origin of the certificate
    • addCertificateRef

      protected void addCertificateRef(CertificateRef certificateRef, eu.europa.esig.dss.enumerations.CertificateRefOrigin origin)
      Adds a CertificateRef with its CertificateRefOrigin
      Parameters:
      certificateRef - the certificate reference to be added
      origin - the origin of the certificate reference
    • getReferencesForCertificateToken

      public List<CertificateRef> getReferencesForCertificateToken(CertificateToken certificateToken)
      Returns list of CertificateRefs found for the given certificateToken
      Parameters:
      certificateToken - CertificateToken to find references for
      Returns:
      list of CertificateRefs
    • findTokensFromRefs

      public Set<CertificateToken> findTokensFromRefs(List<CertificateRef> certificateRefs)
      Returns Set of CertificateTokens for the provided CertificateRefs
      Parameters:
      certificateRefs - list of CertificateRefs
      Returns:
      Set of CertificateTokens
    • getAllCertificateIdentifiers

      public Set<SignerIdentifier> getAllCertificateIdentifiers()
      Returns a Set of all SignerIdentifier For CAdES/PAdES/Timestamp
      Returns:
      a set of SignerIdentifier
    • getCurrentCertificateIdentifier

      public SignerIdentifier getCurrentCertificateIdentifier()
      Returns the current SignerIdentifier For CAdES/PAdES/Timestamp
      Returns:
      the current SignerIdentifier or null
    • getAllCertificateRefs

      public Set<CertificateRef> getAllCertificateRefs()
      Returns a Set of all certificate references
      Returns:
      a Set of CertificateRefs
    • getOrphanCertificateRefs

      public List<CertificateRef> getOrphanCertificateRefs()
      Returns a list of orphan certificate refs
      Returns:
      list of CertificateRefs
    • getCertificateToken

      protected CertificateToken getCertificateToken(SignerIdentifier signerIdentifier)
      Gets a CertificateToken by the given SignerIdentifier
      Parameters:
      signerIdentifier - SignerIdentifier
      Returns:
      CertificateToken
    • getCertificateTokensByOrigin

      protected List<CertificateToken> getCertificateTokensByOrigin(eu.europa.esig.dss.enumerations.CertificateOrigin origin)
      Gets a list of CertificateTokens by the given CertificateOrigin
      Parameters:
      origin - CertificateOrigin
      Returns:
      a list of CertificateTokens
    • getCertificateRefsByOrigin

      protected List<CertificateRef> getCertificateRefsByOrigin(eu.europa.esig.dss.enumerations.CertificateRefOrigin origin)
      Gets a list of CertificateRefs by the given CertificateRefOrigin
      Parameters:
      origin - CertificateRefOrigin
      Returns:
      a list of CertificateRefs
    • getCertificateRefOrigins

      public List<eu.europa.esig.dss.enumerations.CertificateRefOrigin> getCertificateRefOrigins(CertificateRef certificateRef)
      Extracts origins for a given certificateRef
      Parameters:
      certificateRef - CertificateRef to get origins for
      Returns:
      a list of CertificateRefOrigins