public class IssuingCertificateRetriever extends Object implements IIssuingCertificateRetriever
IIssuingCertificateRetriever default implementation.| Constructor and Description |
|---|
IssuingCertificateRetriever()
Creates
IssuingCertificateRetriever instance. |
IssuingCertificateRetriever(IResourceRetriever resourceRetriever)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKnownCertificates(Collection<Certificate> certificates)
Adds certificates collection to known certificates storage, which is used for issuer certificates retrieval.
|
void |
addKnownCertificates(Collection<Certificate> certificates,
CertificateOrigin dataOrigin)
Adds certificates collection to known certificates storage, which is used for issuer certificates retrieval.
|
void |
addTrustedCertificates(Collection<Certificate> certificates)
Add trusted certificates collection to trusted certificates storage.
|
List<X509Certificate[]> |
buildCertificateChains(X509Certificate certificate)
This method tries to rebuild certificate issuer chain.
|
List<X509Certificate[]> |
buildCertificateChains(X509Certificate[] certificate)
This method tries to rebuild certificate issuer chain.
|
CertificateOrigin |
getCertificateOrigin(Certificate certificate)
Gets certificate origin for provided
Certificate. |
Certificate[] |
getCrlIssuerCertificates(CRL crl)
Retrieves the certificate chain for the certificate that should be used to verify the signature on the
CRL response using CRL Authority Information Access (AIA) Extension and known certificates.
|
Certificate[][] |
getCrlIssuerCertificatesByName(CRL crl)
Retrieves the certificate chaind for the certificates that could be used to verify the signature on the
CRL response using CRL Authority Information Access (AIA) Extension and known certificates.
|
protected InputStream |
getIssuerCertByURI(String uri)
Get CA issuers certificates represented as
InputStream. |
com.itextpdf.io.resolver.resource.IAdvancedResourceRetriever |
getResourceRetriever()
Gets the resource retriever currently being used in this CA issuer certificates retriever.
|
TrustedCertificatesStore |
getTrustedCertificatesStore()
Gets
TrustedCertificatesStore to be used to provide more complex trusted certificates configuration. |
boolean |
isCertificateTrusted(Certificate certificate)
Check if provided certificate is present in trusted certificates storage.
|
protected Collection<Certificate> |
parseCertificates(InputStream certsData)
Parses certificates represented as byte array.
|
List<X509Certificate> |
retrieveIssuerCertificate(Certificate certificate)
Retrieve issuer certificate for the provided certificate.
|
Certificate[] |
retrieveMissingCertificates(Certificate[] chain)
Retrieves all possible chains using certificate Authority Information Access (AIA) Extension, known certificates
and trust anchors.
|
Set<Certificate> |
retrieveOCSPResponderByNameCertificate(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp)
Retrieves OCSP responder certificate candidates either from the response certs or
trusted store in case responder certificate isn't found in /Certs.
|
void |
setTrustedCertificates(Collection<Certificate> certificates)
Sets trusted certificate list to be used as certificates trusted for any possible usage.
|
IssuingCertificateRetriever |
withResourceRetriever(com.itextpdf.io.resolver.resource.IAdvancedResourceRetriever resourceRetriever)
Sets a resource retriever for this CA issuer certificates retriever.
|
public IssuingCertificateRetriever()
IssuingCertificateRetriever instance.@Deprecated public IssuingCertificateRetriever(IResourceRetriever resourceRetriever)
withResourceRetriever(com.itextpdf.io.resolver.resource.IAdvancedResourceRetriever)IssuingCertificateRetriever instance.resourceRetriever - an @{link com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever}
instance to use for performing http requests.public Certificate[] retrieveMissingCertificates(Certificate[] chain)
retrieveMissingCertificates in interface IIssuingCertificateRetrieverchain - certificate chain to restore with at least signing certificate.public List<X509Certificate[]> buildCertificateChains(X509Certificate certificate)
certificate - X509Certificate for which issuer chains shall be builtpublic List<X509Certificate[]> buildCertificateChains(X509Certificate[] certificate)
certificate - X509Certificate array for which issuer chains shall be builtpublic IssuingCertificateRetriever withResourceRetriever(com.itextpdf.io.resolver.resource.IAdvancedResourceRetriever resourceRetriever)
This method allows you to provide a custom implementation of IAdvancedResourceRetriever to be used
for fetching CA issuer certificates. By default, DefaultResourceRetriever is used.
resourceRetriever - the custom resource retriever to be used for fetching CA issuer certificatesIssuingCertificateRetrieverpublic com.itextpdf.io.resolver.resource.IAdvancedResourceRetriever getResourceRetriever()
public List<X509Certificate> retrieveIssuerCertificate(Certificate certificate)
certificate - Certificate for which issuer certificate shall be retrievednull if there is no issuer certificate, or it cannot be retrieved.public Set<Certificate> retrieveOCSPResponderByNameCertificate(com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp ocspResp)
ocspResp - basic OCSP response to get responder certificate forpublic Certificate[] getCrlIssuerCertificates(CRL crl)
getCrlIssuerCertificates in interface IIssuingCertificateRetrievercrl - CRL response to retrieve issuer for.public Certificate[][] getCrlIssuerCertificatesByName(CRL crl)
getCrlIssuerCertificatesByName in interface IIssuingCertificateRetrievercrl - CRL response to retrieve issuer for.public void setTrustedCertificates(Collection<Certificate> certificates)
getTrustedCertificatesStore() method is expected to be used.setTrustedCertificates in interface IIssuingCertificateRetrievercertificates - certificate list to be used as certificates trusted for any possible usage.public void addTrustedCertificates(Collection<Certificate> certificates)
certificates - certificates Collection to be addedpublic void addKnownCertificates(Collection<Certificate> certificates)
certificates - certificates Collection to be addedpublic void addKnownCertificates(Collection<Certificate> certificates, CertificateOrigin dataOrigin)
Additionally, adds stores the provided origin for all these certificates.
certificates - certificates Collection to be addeddataOrigin - RevocationDataOrigin from which these certificates come frompublic CertificateOrigin getCertificateOrigin(Certificate certificate)
Certificate.certificate - Certificate for which origin is requestedRevocationDataOrigin for the certificatepublic TrustedCertificatesStore getTrustedCertificatesStore()
TrustedCertificatesStore to be used to provide more complex trusted certificates configuration.TrustedCertificatesStore storagepublic boolean isCertificateTrusted(Certificate certificate)
certificate - Certificate to be checkedtrue if certificate is present in trusted certificates storage, false otherwiseprotected InputStream getIssuerCertByURI(String uri) throws IOException
InputStream.uri - URL URI, which is expected to be used to get issuer certificates from. Usually
CA Issuers value from Authority Information Access (AIA) certificate extension.InputStream.IOException - if an I/O error occurs.protected Collection<Certificate> parseCertificates(InputStream certsData) throws CertificateException
certsData - stream which contains one or more X509 certificates.CertificateException - if parsing error occurs.Copyright © 1998–2026 Apryse Group NV. All rights reserved.