Package eu.europa.esig.dss.spi.x509
Class ListCertificateSource
java.lang.Object
eu.europa.esig.dss.spi.x509.ListCertificateSource
public class ListCertificateSource extends Object
This class operates on several
CertificateSource with the composite
design pattern.-
Constructor Summary
Constructors Constructor Description ListCertificateSource()Default constructorListCertificateSource(CertificateSource certificateSource)This constructor allows to instantiate an object of the class with oneCertificateSourceListCertificateSource(List<CertificateSource> certificateSources)This constructor allows to instantiate an object of the class with a list ofCertificateSource -
Method Summary
Modifier and Type Method Description voidadd(CertificateSource certificateSource)This method allows to add a certificate source to the listvoidaddAll(ListCertificateSource listCertificateSource)Allows to add a list of embedded certificate sources to the list of certificate sourcesvoidaddAll(List<CertificateSource> certificateSources)Allows to add a list of certificate sourcesbooleanareAllCertSourcesTrusted()Checks if the ListCertificateSource contains only trusted CertificateSourcesSet<CertificateToken>getAllCertificateTokens()Returns a set of all containing certificate tokensSet<eu.europa.esig.dss.spi.x509.CertificateSourceEntity>getAllEntities()Returns a set of all containingCertificateSourceEntitySet<CertificateToken>getByCertificateIdentifier(CertificateIdentifier certificateIdentifier)This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenCertificateIdentifier.Set<CertificateToken>getByPublicKey(PublicKey publicKey)Set<CertificateToken>getBySki(byte[] ski)This method returns the foundCertificateTokenfrom allCertificateSourcefor the given subject key identifier (SHA-1 of the public key).Set<CertificateToken>getBySubject(X500PrincipalHelper subject)This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenX500PrincipalHelper.Set<CertificateSourceType>getCertificateSource(CertificateToken certificateToken)This method return the differentCertificateSourceTypewhere the certificate is foundintgetNumberOfCertificates()This method returns the number of foundCertificateTokenin all sourcesintgetNumberOfEntities()This method returns the number of foundCertificateSourceEntityin all sourcesintgetNumberOfSources()This method returns the number of setCertificateSourcesList<CertificateSource>getSources()Returns an unmodifiable list of embeddedCertificateSourcesbooleanisAllSelfSigned()This method checks in all sources if all embedded certificate are self-signedbooleanisEmpty()This method checks if the embed sources is emptybooleanisTrusted(CertificateToken certificateToken)This method checks in all sources in the given certificate is trusted
-
Constructor Details
-
ListCertificateSource
public ListCertificateSource()Default constructor -
ListCertificateSource
This constructor allows to instantiate an object of the class with oneCertificateSource- Parameters:
certificateSource-CertificateSource
-
ListCertificateSource
This constructor allows to instantiate an object of the class with a list ofCertificateSource- Parameters:
certificateSources- a list ofCertificateSource
-
-
Method Details
-
addAll
Allows to add a list of embedded certificate sources to the list of certificate sources- Parameters:
listCertificateSource-ListCertificateSource
-
addAll
Allows to add a list of certificate sources- Parameters:
certificateSources- a list ofCertificateSources to add
-
add
This method allows to add a certificate source to the list- Parameters:
certificateSource-CertificateSource
-
getSources
Returns an unmodifiable list of embeddedCertificateSources- Returns:
- a list of
CertificateSources
-
getAllCertificateTokens
Returns a set of all containing certificate tokens- Returns:
- set of
CertificateTokens
-
getAllEntities
Returns a set of all containingCertificateSourceEntity- 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
-
isTrusted
This method checks in all sources in the given certificate is trusted- Parameters:
certificateToken- theCertificateTokento 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
This method return the differentCertificateSourceTypewhere the certificate is found- Parameters:
certificateToken- theCertificateTokento be find- Returns:
- a Set with the different sources
-
getByPublicKey
- Parameters:
publicKey- thePublicKeyto find in the sources- Returns:
- a Set of found
CertificateToken
-
getBySki
This method returns the foundCertificateTokenfrom allCertificateSourcefor 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
This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenX500PrincipalHelper.- Parameters:
subject- theX500PrincipalHelperto find in the sources- Returns:
- a Set of found
CertificateToken
-
getByCertificateIdentifier
public Set<CertificateToken> getByCertificateIdentifier(CertificateIdentifier certificateIdentifier)This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenCertificateIdentifier.- Parameters:
certificateIdentifier- theCertificateIdentifierto find in the sources- Returns:
- a Set of found
CertificateToken
-
getNumberOfSources
public int getNumberOfSources()This method returns the number of setCertificateSources- Returns:
- the number of found
CertificateSource
-
getNumberOfCertificates
public int getNumberOfCertificates()This method returns the number of foundCertificateTokenin all sources- Returns:
- the number of found
CertificateToken
-
getNumberOfEntities
public int getNumberOfEntities()This method returns the number of foundCertificateSourceEntityin all sources- Returns:
- the number of found
CertificateSourceEntity
-