Package eu.europa.esig.dss.spi.x509
Class ListCertificateSource
java.lang.Object
eu.europa.esig.dss.spi.x509.ListCertificateSource
- All Implemented Interfaces:
Serializable
This class operates on several
CertificateSource
with the composite
design pattern.- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructorListCertificateSource
(CertificateSource certificateSource) This constructor allows to instantiate an object of the class with oneCertificateSource
ListCertificateSource
(List<CertificateSource> certificateSources) This constructor allows to instantiate an object of the class with a list ofCertificateSource
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(CertificateSource certificateSource) This method allows to add a certificate source to the listvoid
addAll
(ListCertificateSource listCertificateSource) Allows to add a list of embedded certificate sources to the list of certificate sourcesvoid
addAll
(List<CertificateSource> certificateSources) Allows to add a list of certificate sourcesboolean
Checks if the ListCertificateSource contains only trusted CertificateSourcesboolean
This method verifies if the current list of certificate sources contains a trusted certificate sourcefindTokensFromRefs
(CertificateRef certificateRef) This method returns the foundCertificateToken
from allCertificateSource
for the givencertificateRef
.Returns a set of all containing certificate tokensSet<eu.europa.esig.dss.spi.x509.CertificateSourceEntity>
Returns a set of all containingCertificateSourceEntity
getByCertificateDigest
(Digest digest) getByCertificateIdentifier
(SignerIdentifier signerIdentifier) This method returns the foundCertificateToken
from allCertificateSource
for the givenSignerIdentifier
.getByPublicKey
(PublicKey publicKey) getBySki
(byte[] ski) This method returns the foundCertificateToken
from allCertificateSource
for the given subject key identifier (SHA-1 of the public key).getBySubject
(X500PrincipalHelper subject) This method returns the foundCertificateToken
from allCertificateSource
for the givenX500PrincipalHelper
.getCertificateSource
(CertificateToken certificateToken) This method return the differentCertificateSourceType
where the certificate is foundint
This method returns the number of foundCertificateToken
in all sourcesint
This method returns the number of foundCertificateSourceEntity
in all sourcesint
This method returns the number of setCertificateSource
sReturns an unmodifiable list of embeddedCertificateSource
sboolean
This method checks in all sources if all embedded certificate are self-signedboolean
isEmpty()
This method checks if the embed sources is emptyboolean
isTrusted
(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 ofCertificateSource
s to add
-
add
This method allows to add a certificate source to the list- Parameters:
certificateSource
-CertificateSource
-
getSources
Returns an unmodifiable list of embeddedCertificateSource
s- Returns:
- a list of
CertificateSource
s
-
getAllCertificateTokens
Returns a set of all containing certificate tokens- Returns:
- set of
CertificateToken
s
-
getAllEntities
Returns a set of all containingCertificateSourceEntity
- Returns:
- set of
CertificateSourceEntity
s
-
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
This method checks in all sources in the given certificate is trusted- Parameters:
certificateToken
- theCertificateToken
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
This method return the differentCertificateSourceType
where the certificate is found- Parameters:
certificateToken
- theCertificateToken
to be find- Returns:
- a Set with the different sources
-
getByPublicKey
- Parameters:
publicKey
- thePublicKey
to find in the sources- Returns:
- a Set of found
CertificateToken
-
getBySki
This method returns the foundCertificateToken
from allCertificateSource
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
This method returns the foundCertificateToken
from allCertificateSource
for the givenX500PrincipalHelper
.- Parameters:
subject
- theX500PrincipalHelper
to find in the sources- Returns:
- a Set of found
CertificateToken
-
getByCertificateIdentifier
This method returns the foundCertificateToken
from allCertificateSource
for the givenSignerIdentifier
.- Parameters:
signerIdentifier
- theSignerIdentifier
to find in the sources- Returns:
- a Set of found
CertificateToken
-
getByCertificateDigest
- Parameters:
digest
- theDigest
to find in the sources- Returns:
- a Set of found
CertificateToken
-
findTokensFromRefs
This method returns the foundCertificateToken
from allCertificateSource
for the givencertificateRef
.- Parameters:
certificateRef
- theCertificateRef
to find in the sources- Returns:
- a Set of found
CertificateToken
-
getNumberOfSources
public int getNumberOfSources()This method returns the number of setCertificateSource
s- Returns:
- the number of found
CertificateSource
-
getNumberOfCertificates
public int getNumberOfCertificates()This method returns the number of foundCertificateToken
in all sources- Returns:
- the number of found
CertificateToken
-
getNumberOfEntities
public int getNumberOfEntities()This method returns the number of foundCertificateSourceEntity
in all sources- Returns:
- the number of found
CertificateSourceEntity
-