public class LazyTslCertificateSource extends eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource implements TSLCertificateSource
The goal is to postpone initialization and downloading of TSL until it is really needed to speed up processes. For example, it is not necessary to download TSL to open container and see signature parameters, but DSS library requires the presence of certificate source. TSL should be downloaded for validation and other functionality where it is really necessary to check the certificates.
To achieve that, a lazily initialized certificate source is used.
Constructor and Description |
---|
LazyTslCertificateSource(TslLoader tslLoader) |
Modifier and Type | Method and Description |
---|---|
eu.europa.esig.dss.model.x509.CertificateToken |
addCertificate(eu.europa.esig.dss.model.x509.CertificateToken certificate) |
void |
addTSLCertificate(X509Certificate certificate)
This method allows to define (to add) any certificate as trusted.
|
Set<eu.europa.esig.dss.model.x509.CertificateToken> |
getByPublicKey(PublicKey publicKey) |
Set<eu.europa.esig.dss.model.x509.CertificateToken> |
getBySubject(eu.europa.esig.dss.model.x509.X500PrincipalHelper subject) |
Long |
getCacheExpirationTime() |
List<eu.europa.esig.dss.model.x509.CertificateToken> |
getCertificates()
Retrieves the list of all certificate tokens from this source.
|
eu.europa.esig.dss.enumerations.CertificateSourceType |
getCertificateSourceType() |
Long |
getLastCacheReloadingTime() |
int |
getNumberOfCertificates()
This method returns the number of stored certificates in this source
|
eu.europa.esig.dss.spi.tsl.TLValidationJobSummary |
getSummary() |
List<eu.europa.esig.dss.spi.tsl.TrustProperties> |
getTrustServices(eu.europa.esig.dss.model.x509.CertificateToken token)
Retrieves the list of trust properties for the gifen certificate token.
|
TslLoader |
getTslLoader() |
void |
invalidateCache()
Invalidates cache
Only applicable when cache is used.
|
boolean |
isKnown(eu.europa.esig.dss.model.x509.CertificateToken token) |
boolean |
isTrusted(eu.europa.esig.dss.model.x509.CertificateToken certificateToken) |
void |
refresh() |
void |
setCacheExpirationTime(Long cacheExpirationTime) |
addCertificate, getAlternativeCRLUrls, getAlternativeOCSPUrls, getNumberOfTrustedPublicKeys, setSummary, setTrustPropertiesByCertificates
importAsTrusted
findTokensFromCertRef, getByCertificateDigest, getBySignerIdentifier, getBySki, getEntities, getNumberOfEntities, isAllSelfSigned, isCertificateSourceEqual, isCertificateSourceEquivalent
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCertificate, getNumberOfTrustedPublicKeys
public LazyTslCertificateSource(TslLoader tslLoader)
tslLoader
- TSL loaderpublic eu.europa.esig.dss.spi.tsl.TLValidationJobSummary getSummary()
getSummary
in interface TSLCertificateSource
getSummary
in class eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource
public int getNumberOfCertificates()
TSLCertificateSource
getNumberOfCertificates
in interface TSLCertificateSource
getNumberOfCertificates
in class eu.europa.esig.dss.spi.x509.CommonCertificateSource
public eu.europa.esig.dss.model.x509.CertificateToken addCertificate(eu.europa.esig.dss.model.x509.CertificateToken certificate)
addCertificate
in interface eu.europa.esig.dss.spi.x509.CertificateSource
addCertificate
in class eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource
public boolean isKnown(eu.europa.esig.dss.model.x509.CertificateToken token)
isKnown
in interface eu.europa.esig.dss.spi.x509.CertificateSource
isKnown
in class eu.europa.esig.dss.spi.x509.CommonCertificateSource
public List<eu.europa.esig.dss.spi.tsl.TrustProperties> getTrustServices(eu.europa.esig.dss.model.x509.CertificateToken token)
TSLCertificateSource
getTrustServices
in interface TSLCertificateSource
getTrustServices
in class eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource
public eu.europa.esig.dss.enumerations.CertificateSourceType getCertificateSourceType()
getCertificateSourceType
in interface eu.europa.esig.dss.spi.x509.CertificateSource
getCertificateSourceType
in class eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource
public void addTSLCertificate(X509Certificate certificate)
TSLCertificateSource
addTSLCertificate
in interface TSLCertificateSource
certificate
- X509 certificate to be added to the list, a certificate you have to trust.public Set<eu.europa.esig.dss.model.x509.CertificateToken> getBySubject(eu.europa.esig.dss.model.x509.X500PrincipalHelper subject)
getBySubject
in interface eu.europa.esig.dss.spi.x509.CertificateSource
getBySubject
in class eu.europa.esig.dss.spi.x509.CommonCertificateSource
public Set<eu.europa.esig.dss.model.x509.CertificateToken> getByPublicKey(PublicKey publicKey)
getByPublicKey
in interface eu.europa.esig.dss.spi.x509.CertificateSource
getByPublicKey
in class eu.europa.esig.dss.spi.x509.CommonCertificateSource
public List<eu.europa.esig.dss.model.x509.CertificateToken> getCertificates()
TSLCertificateSource
getCertificates
in interface eu.europa.esig.dss.spi.x509.CertificateSource
getCertificates
in interface TSLCertificateSource
getCertificates
in class eu.europa.esig.dss.spi.x509.CommonCertificateSource
public boolean isTrusted(eu.europa.esig.dss.model.x509.CertificateToken certificateToken)
isTrusted
in interface eu.europa.esig.dss.spi.x509.CertificateSource
isTrusted
in class eu.europa.esig.dss.spi.x509.CommonTrustedCertificateSource
public void invalidateCache()
TSLCertificateSource
invalidateCache
in interface TSLCertificateSource
public void refresh()
refresh
in interface TSLCertificateSource
public Long getLastCacheReloadingTime()
public Long getCacheExpirationTime()
public void setCacheExpirationTime(Long cacheExpirationTime)
public TslLoader getTslLoader()
Copyright © 2024. All rights reserved.