Package eu.europa.esig.dss.spi.tsl
Class TrustedListsCertificateSource
java.lang.Object
eu.europa.esig.dss.spi.x509.CommonCertificateSource
eu.europa.esig.dss.spi.x509.CommonTrustedCertificateSource
eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource
- All Implemented Interfaces:
TrustedCertificateSourceWithTime
,TrustPropertiesCertificateSource
,CertificateSource
,TrustedCertificateSource
,Serializable
public class TrustedListsCertificateSource
extends CommonTrustedCertificateSource
implements TrustPropertiesCertificateSource
This class allows injection of trusted certificates from Trusted Lists
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.spi.x509.CommonCertificateSource
certificateMatcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCertificate
(CertificateToken certificate) This method is not applicable for this kind of certificate source.getAlternativeCRLUrls
(CertificateToken trustAnchor) Returns a list of alternative CRL access point Urls for certificates issued by the current trust anchorgetAlternativeOCSPUrls
(CertificateToken trustAnchor) Returns a list of alternative OCSP access point Urls for certificates issued by the current trust anchorThis method returns the certificate source type associated to the implementation class.int
Gets the number of trusted entity keys (public key + subject name)Gets TL Validation job summarygetTrustServices
(CertificateToken token) Returns TrustProperties for the given certificate, when applicablegetTrustTime
(CertificateToken token) Returns trust time period for the given certificate, when the certificate is considered as a trust anchor.boolean
isTrusted
(CertificateToken certificateToken) This method checks if a given certificate is trustedboolean
isTrustedAtTime
(CertificateToken certificateToken, Date controlTime) This method checks if a given certificate is trusted at thecontrolTime
void
setSummary
(TLValidationJobSummary summary) Sets TL Validation job summaryvoid
setTrustPropertiesByCertificates
(Map<CertificateToken, List<TrustProperties>> trustPropertiesByCerts) The method allows to fill the CertificateSourcevoid
setTrustTimeByCertificates
(Map<CertificateToken, List<CertificateTrustTime>> trustTimeByCertificate) The method allows to fill the CertificateSource with trusted time periodsMethods inherited from class eu.europa.esig.dss.spi.x509.CommonTrustedCertificateSource
importAsTrusted
Methods inherited from class eu.europa.esig.dss.spi.x509.CommonCertificateSource
doesCertificateReferenceMatch, findTokensFromCertRef, getByCertificateDigest, getByEntityKey, getByPublicKey, getBySignerIdentifier, getBySki, getBySubject, getCertificates, getEntities, getNumberOfCertificates, getNumberOfEntities, isAllSelfSigned, isCertificateSourceEqual, isCertificateSourceEquivalent, isKnown, removeCertificate, reset
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.spi.x509.CertificateSource
findTokensFromCertRef, getByCertificateDigest, getByEntityKey, getByPublicKey, getBySignerIdentifier, getBySki, getBySubject, getCertificates, getEntities, isAllSelfSigned, isCertificateSourceEqual, isCertificateSourceEquivalent, isKnown
-
Constructor Details
-
TrustedListsCertificateSource
public TrustedListsCertificateSource()The default constructor.
-
-
Method Details
-
getSummary
Gets TL Validation job summary- Specified by:
getSummary
in interfaceTrustPropertiesCertificateSource
- Returns:
TLValidationJobSummary
-
setSummary
Sets TL Validation job summary- Specified by:
setSummary
in interfaceTrustPropertiesCertificateSource
- Parameters:
summary
-TLValidationJobSummary
-
getCertificateSourceType
Description copied from interface:CertificateSource
This method returns the certificate source type associated to the implementation class.- Specified by:
getCertificateSourceType
in interfaceCertificateSource
- Overrides:
getCertificateSourceType
in classCommonTrustedCertificateSource
- Returns:
- the certificate origin
-
addCertificate
This method is not applicable for this kind of certificate source. You should usesetTrustPropertiesByCertificates(java.util.Map<eu.europa.esig.dss.model.x509.CertificateToken, java.util.List<eu.europa.esig.dss.model.tsl.TrustProperties>>)
- Specified by:
addCertificate
in interfaceCertificateSource
- Overrides:
addCertificate
in classCommonCertificateSource
- Parameters:
certificate
- the certificate you have to trust- Returns:
- the corresponding certificate token
-
setTrustPropertiesByCertificates
public void setTrustPropertiesByCertificates(Map<CertificateToken, List<TrustProperties>> trustPropertiesByCerts) Description copied from interface:TrustPropertiesCertificateSource
The method allows to fill the CertificateSource- Specified by:
setTrustPropertiesByCertificates
in interfaceTrustPropertiesCertificateSource
- Parameters:
trustPropertiesByCerts
- map betweenCertificateToken
s and a list ofTrustProperties
-
getTrustServices
Description copied from interface:TrustPropertiesCertificateSource
Returns TrustProperties for the given certificate, when applicable- Specified by:
getTrustServices
in interfaceTrustPropertiesCertificateSource
- Parameters:
token
-CertificateToken
- Returns:
- a list of
TrustProperties
-
setTrustTimeByCertificates
public void setTrustTimeByCertificates(Map<CertificateToken, List<CertificateTrustTime>> trustTimeByCertificate) Description copied from interface:TrustPropertiesCertificateSource
The method allows to fill the CertificateSource with trusted time periods- Specified by:
setTrustTimeByCertificates
in interfaceTrustPropertiesCertificateSource
- Parameters:
trustTimeByCertificate
- map betweenCertificateToken
s and a list ofCertificateTrustTime
s
-
getTrustTime
Description copied from interface:TrustedCertificateSourceWithTime
Returns trust time period for the given certificate, when the certificate is considered as a trust anchor. For an unbounded period of trust time, returns aCertificateTrustTime
with empty values. When the certificate is not trusted at any time, returns not trustedCertificateTrustTime
entry.- Specified by:
getTrustTime
in interfaceTrustedCertificateSourceWithTime
- Parameters:
token
-CertificateToken
- Returns:
CertificateTrustTime
-
isTrustedAtTime
Description copied from interface:CertificateSource
This method checks if a given certificate is trusted at thecontrolTime
- Specified by:
isTrustedAtTime
in interfaceCertificateSource
- Overrides:
isTrustedAtTime
in classCommonCertificateSource
- Parameters:
certificateToken
- the certificate to be testedcontrolTime
-Date
- Returns:
- true if the certificate is trusted
-
getAlternativeOCSPUrls
Description copied from interface:TrustedCertificateSource
Returns a list of alternative OCSP access point Urls for certificates issued by the current trust anchor- Specified by:
getAlternativeOCSPUrls
in interfaceTrustedCertificateSource
- Overrides:
getAlternativeOCSPUrls
in classCommonTrustedCertificateSource
- Parameters:
trustAnchor
-CertificateToken
- Returns:
- a list of
String
s
-
getAlternativeCRLUrls
Description copied from interface:TrustedCertificateSource
Returns a list of alternative CRL access point Urls for certificates issued by the current trust anchor- Specified by:
getAlternativeCRLUrls
in interfaceTrustedCertificateSource
- Overrides:
getAlternativeCRLUrls
in classCommonTrustedCertificateSource
- Parameters:
trustAnchor
-CertificateToken
- Returns:
- a list of
String
s
-
isTrusted
Description copied from interface:CertificateSource
This method checks if a given certificate is trusted- Specified by:
isTrusted
in interfaceCertificateSource
- Overrides:
isTrusted
in classCommonTrustedCertificateSource
- Parameters:
certificateToken
- the certificate to be tested- Returns:
- true if the certificate is trusted
-
getNumberOfTrustedEntityKeys
public int getNumberOfTrustedEntityKeys()Gets the number of trusted entity keys (public key + subject name)- Returns:
- the number of trusted entity keys (public key + subject name)
-