Package com.itextpdf.signatures
Class IssuingCertificateRetriever
java.lang.Object
com.itextpdf.signatures.IssuingCertificateRetriever
- All Implemented Interfaces:
-
IIssuingCertificateRetriever
IIssuingCertificateRetriever
default implementation.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves certificates that can be used to verify the signature on the CRL response using CRL Authority Information Access (AIA) Extension.protected InputStream
getIssuerCertByURI
(String uri) Get CA issuers certificates represented asInputStream
.protected Collection<Certificate>
parseCertificates
(InputStream certsData) Parses certificates represented as byte array.retrieveMissingCertificates
(Certificate[] chain) Retrieves missing certificates in chain using certificate Authority Information Access (AIA) Extension.void
setTrustedCertificates
(Collection<Certificate> certificates) Sets trusted certificate list to be used for the missing certificates retrieving by the issuer name.
-
Constructor Details
-
IssuingCertificateRetriever
public IssuingCertificateRetriever()CreatesIssuingCertificateRetriever
instance.
-
-
Method Details
-
retrieveMissingCertificates
Retrieves missing certificates in chain using certificate Authority Information Access (AIA) Extension.- Specified by:
-
retrieveMissingCertificates
in interfaceIIssuingCertificateRetriever
- Parameters:
-
chain
- certificate chain to restore with at least signing certificate. - Returns:
- full chain of trust or maximum chain that could be restored in case missing certificates cannot be retrieved from AIA extension.
-
getCrlIssuerCertificates
Retrieves certificates that can be used to verify the signature on the CRL response using CRL Authority Information Access (AIA) Extension.- Specified by:
-
getCrlIssuerCertificates
in interfaceIIssuingCertificateRetriever
- Parameters:
-
crl
- CRL response to retrieve issuer for. - Returns:
- certificates retrieved from CRL AIA extension or an empty list in case certificates cannot be retrieved.
-
setTrustedCertificates
Sets trusted certificate list to be used for the missing certificates retrieving by the issuer name.- Specified by:
-
setTrustedCertificates
in interfaceIIssuingCertificateRetriever
- Parameters:
-
certificates
- certificate list for getting missing certificates in chain or CRL response issuer certificates.
-
getIssuerCertByURI
Get CA issuers certificates represented asInputStream
.- Parameters:
-
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. - Returns:
-
CA issuer certificate (or chain) bytes, represented as
InputStream
. - Throws:
-
IOException
- if an I/O error occurs.
-
parseCertificates
protected Collection<Certificate> parseCertificates(InputStream certsData) throws CertificateException Parses certificates represented as byte array.- Parameters:
-
certsData
- stream which contains one or more X509 certificates. - Returns:
- a (possibly empty) collection of the certificates read from the given byte array.
- Throws:
-
CertificateException
- if parsing error occurs.
-