Class ListCertificateSource

java.lang.Object
eu.europa.esig.dss.spi.x509.ListCertificateSource
All Implemented Interfaces:
Serializable

public class ListCertificateSource extends Object implements Serializable
This class operates on several CertificateSource with the composite design pattern.
See Also:
  • Constructor Details

    • ListCertificateSource

      public ListCertificateSource()
      Default constructor
    • ListCertificateSource

      public ListCertificateSource(CertificateSource certificateSource)
      This constructor allows to instantiate an object of the class with one CertificateSource
      Parameters:
      certificateSource - CertificateSource
    • ListCertificateSource

      public ListCertificateSource(List<CertificateSource> certificateSources)
      This constructor allows to instantiate an object of the class with a list of CertificateSource
      Parameters:
      certificateSources - a list of CertificateSource
  • Method Details

    • addAll

      public void addAll(ListCertificateSource listCertificateSource)
      Allows to add a list of embedded certificate sources to the list of certificate sources
      Parameters:
      listCertificateSource - ListCertificateSource
    • addAll

      public void addAll(List<CertificateSource> certificateSources)
      Allows to add a list of certificate sources
      Parameters:
      certificateSources - a list of CertificateSources to add
    • add

      public void add(CertificateSource certificateSource)
      This method allows to add a certificate source to the list
      Parameters:
      certificateSource - CertificateSource
    • getSources

      public List<CertificateSource> getSources()
      Returns an unmodifiable list of embedded CertificateSources
      Returns:
      a list of CertificateSources
    • getAllCertificateTokens

      public Set<CertificateToken> getAllCertificateTokens()
      Returns a set of all containing certificate tokens
      Returns:
      set of CertificateTokens
    • getAllEntities

      public Set<eu.europa.esig.dss.spi.x509.CertificateSourceEntity> getAllEntities()
      Returns a set of all containing CertificateSourceEntity
      Returns:
      set of CertificateSourceEntitys
    • isEmpty

      public boolean isEmpty()
      This method checks if the embed sources is empty
      Returns:
      true if no source has been added
    • areAllCertSourcesTrusted

      public boolean areAllCertSourcesTrusted()
      Checks if the ListCertificateSource contains only trusted CertificateSources
      Returns:
      TRUE if all embedded CertificateSources are trusted, FALSE otherwise
    • containsTrustedCertSources

      public boolean containsTrustedCertSources()
      This method verifies if the current list of certificate sources contains a trusted certificate source
      Returns:
      TRUE if the list certificate source contains a trusted certificate source, FALSE otherwise
    • isTrusted

      public boolean isTrusted(CertificateToken certificateToken)
      This method checks in all sources in the given certificate is trusted
      Parameters:
      certificateToken - the CertificateToken to be checked
      Returns:
      true if the certificate is trusted
    • isAllSelfSigned

      public boolean isAllSelfSigned()
      This method checks in all sources if all embedded certificate are self-signed
      Returns:
      true if all certificates from all sources are self-signed
    • getCertificateSource

      public Set<CertificateSourceType> getCertificateSource(CertificateToken certificateToken)
      This method return the different CertificateSourceType where the certificate is found
      Parameters:
      certificateToken - the CertificateToken to be find
      Returns:
      a Set with the different sources
    • getByPublicKey

      public Set<CertificateToken> getByPublicKey(PublicKey publicKey)
      This method returns the found CertificateToken from all CertificateSource for the given PublicKey.
      Parameters:
      publicKey - the PublicKey to find in the sources
      Returns:
      a Set of found CertificateToken
    • getBySki

      public Set<CertificateToken> getBySki(byte[] ski)
      This method returns the found CertificateToken from all CertificateSource for the given subject key identifier (SHA-1 of the public key).
      Parameters:
      ski - the subject key identifier to find in the sources
      Returns:
      a Set of found CertificateToken
    • getBySubject

      public Set<CertificateToken> getBySubject(X500PrincipalHelper subject)
      This method returns the found CertificateToken from all CertificateSource for the given X500PrincipalHelper.
      Parameters:
      subject - the X500PrincipalHelper to find in the sources
      Returns:
      a Set of found CertificateToken
    • getByCertificateIdentifier

      public Set<CertificateToken> getByCertificateIdentifier(SignerIdentifier signerIdentifier)
      This method returns the found CertificateToken from all CertificateSource for the given SignerIdentifier.
      Parameters:
      signerIdentifier - the SignerIdentifier to find in the sources
      Returns:
      a Set of found CertificateToken
    • getByCertificateDigest

      public Set<CertificateToken> getByCertificateDigest(Digest digest)
      This method returns the found CertificateToken from all CertificateSource for the given Digest.
      Parameters:
      digest - the Digest to find in the sources
      Returns:
      a Set of found CertificateToken
    • findTokensFromRefs

      public Set<CertificateToken> findTokensFromRefs(CertificateRef certificateRef)
      This method returns the found CertificateToken from all CertificateSource for the given certificateRef.
      Parameters:
      certificateRef - the CertificateRef to find in the sources
      Returns:
      a Set of found CertificateToken
    • getNumberOfSources

      public int getNumberOfSources()
      This method returns the number of set CertificateSources
      Returns:
      the number of found CertificateSource
    • getNumberOfCertificates

      public int getNumberOfCertificates()
      This method returns the number of found CertificateToken in all sources
      Returns:
      the number of found CertificateToken
    • getNumberOfEntities

      public int getNumberOfEntities()
      This method returns the number of found CertificateSourceEntity in all sources
      Returns:
      the number of found CertificateSourceEntity