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
ConstructorsConstructorDescriptionDefault 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 TypeMethodDescriptionvoidadd(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 sourcesbooleanChecks if the ListCertificateSource contains only trusted CertificateSourcesbooleanThis method verifies if the current list of certificate sources contains a trusted certificate sourcefindTokensFromRefs(CertificateRef certificateRef) This method returns the foundCertificateTokenfrom allCertificateSourcefor the givencertificateRef.Returns a set of all containing certificate tokensSet<eu.europa.esig.dss.spi.x509.CertificateSourceEntity>Returns a set of all containingCertificateSourceEntitygetByCertificateDigest(Digest digest) getByCertificateIdentifier(SignerIdentifier signerIdentifier) This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenSignerIdentifier.getByPublicKey(PublicKey publicKey) getBySki(byte[] ski) This method returns the foundCertificateTokenfrom allCertificateSourcefor the given subject key identifier (SHA-1 of the public key).getBySubject(X500PrincipalHelper subject) This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenX500PrincipalHelper.getCertificateSource(CertificateToken certificateToken) This method return the differentCertificateSourceTypewhere the certificate is foundintThis method returns the number of foundCertificateTokenin all sourcesintThis method returns the number of foundCertificateSourceEntityin all sourcesintThis method returns the number of setCertificateSourcesReturns an unmodifiable list of embeddedCertificateSourcesbooleanThis 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
-
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- 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
This method returns the foundCertificateTokenfrom allCertificateSourcefor the givenSignerIdentifier.- Parameters:
signerIdentifier- theSignerIdentifierto find in the sources- Returns:
- a Set of found
CertificateToken
-
getByCertificateDigest
- Parameters:
digest- theDigestto find in the sources- Returns:
- a Set of found
CertificateToken
-
findTokensFromRefs
This method returns the foundCertificateTokenfrom allCertificateSourcefor the givencertificateRef.- Parameters:
certificateRef- theCertificateRefto 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
-