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 oneCertificateSource
ListCertificateSource(List<CertificateSource> certificateSources)
This constructor allows to instantiate an object of the class with a list ofCertificateSource
-
Method Summary
Modifier and Type Method Description void
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
areAllCertSourcesTrusted()
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 containingCertificateSourceEntity
Set<CertificateToken>
getByCertificateIdentifier(CertificateIdentifier certificateIdentifier)
This method returns the foundCertificateToken
from allCertificateSource
for the givenCertificateIdentifier
.Set<CertificateToken>
getByPublicKey(PublicKey publicKey)
Set<CertificateToken>
getBySki(byte[] ski)
This method returns the foundCertificateToken
from allCertificateSource
for the given subject key identifier (SHA-1 of the public key).Set<CertificateToken>
getBySubject(X500PrincipalHelper subject)
This method returns the foundCertificateToken
from allCertificateSource
for the givenX500PrincipalHelper
.Set<CertificateSourceType>
getCertificateSource(CertificateToken certificateToken)
This method return the differentCertificateSourceType
where the certificate is foundint
getNumberOfCertificates()
This method returns the number of foundCertificateToken
in all sourcesint
getNumberOfEntities()
This method returns the number of foundCertificateSourceEntity
in all sourcesint
getNumberOfSources()
This method returns the number of setCertificateSource
sList<CertificateSource>
getSources()
Returns an unmodifiable list of embeddedCertificateSource
sboolean
isAllSelfSigned()
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
-
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
public Set<CertificateToken> getByCertificateIdentifier(CertificateIdentifier certificateIdentifier)This method returns the foundCertificateToken
from allCertificateSource
for the givenCertificateIdentifier
.- Parameters:
certificateIdentifier
- theCertificateIdentifier
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
-