Package eu.europa.esig.dss.spi.x509
Interface CertificateSource
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CAdESCertificateSource,CMSCertificateSource,CommonCertificateSource,CommonTrustedCertificateSource,KeyStoreCertificateSource,PAdESCertificateSource,SignatureCertificateSource,TimestampCertificateSource,TrustedListsCertificateSource,XAdESCertificateSource
public interface CertificateSource extends Serializable
The validation of a certificate requires to access some other certificates from multiple sources (Trusted List, Trust Store, the signature itself). This interface provides an abstraction for accessing a certificate, regardless of the source.
-
-
Method Summary
Modifier and Type Method Description CertificateTokenaddCertificate(CertificateToken certificate)This method allows to manually add any certificate to the source.List<CertificateToken>getCertificates()Retrieves the unmodifiable list of all certificate tokens from this source.CertificateSourceTypegetCertificateSourceType()This method returns the certificate source type associated to the implementation class.booleanisTrusted(CertificateToken certificateToken)This method checks if a given certificate is trusted
-
-
-
Method Detail
-
addCertificate
CertificateToken addCertificate(CertificateToken certificate)
This method allows to manually add any certificate to the source. The type of the source is automatically set par each specific implementation.- Parameters:
certificate- the certificate you have to trust- Returns:
- the corresponding certificate token
-
getCertificateSourceType
CertificateSourceType getCertificateSourceType()
This method returns the certificate source type associated to the implementation class.- Returns:
- the certificate origin
-
getCertificates
List<CertificateToken> getCertificates()
Retrieves the unmodifiable list of all certificate tokens from this source.- Returns:
- all certificates from this source
-
isTrusted
boolean isTrusted(CertificateToken certificateToken)
This method checks if a given certificate is trusted- Parameters:
certificateToken- the certificate to be tested- Returns:
- true if the certificate is trusted
-
-