public class OcspClientBouncyCastle extends Object implements IOcspClient
| Constructor and Description |
|---|
OcspClientBouncyCastle(OCSPVerifier verifier)
Creates
OcspClient. |
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
createRequestAndResponse(X509Certificate checkCert,
X509Certificate rootCert,
String url)
Create OCSP request and get the response for this request, represented as
InputStream. |
protected static com.itextpdf.commons.bouncycastle.cert.ocsp.IOCSPReq |
generateOCSPRequest(X509Certificate issuerCert,
BigInteger serialNumber)
Generates an OCSP request using BouncyCastle.
|
com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp |
getBasicOCSPResp(X509Certificate checkCert,
X509Certificate rootCert,
String url)
Gets OCSP response.
|
byte[] |
getEncoded(X509Certificate checkCert,
X509Certificate rootCert,
String url)
Fetch a DER-encoded BasicOCSPResponse from an OCSP responder.
|
public OcspClientBouncyCastle(OCSPVerifier verifier)
OcspClient.verifier - will be used for response verification.OCSPVerifierpublic com.itextpdf.commons.bouncycastle.cert.ocsp.IBasicOCSPResp getBasicOCSPResp(X509Certificate checkCert, X509Certificate rootCert, String url)
OCSPVerifier was set, the response will be checked.checkCert - to certificate to checkrootCert - the parent certificateurl - to get the verificationIBasicOCSPResp an OCSP response wrapperpublic byte[] getEncoded(X509Certificate checkCert, X509Certificate rootCert, String url)
Note: do not pass in the full DER-encoded OCSPResponse object obtained from the responder, only the DER-encoded BasicOCSPResponse value contained in the response data.
getEncoded in interface IOcspClientcheckCert - Certificate to check.rootCert - The parent certificate.url - The URL of the OCSP responder endpoint. If null, implementations can
attempt to obtain a URL from the AuthorityInformationAccess extension of
the certificate, or from another implementation-specific source.protected static com.itextpdf.commons.bouncycastle.cert.ocsp.IOCSPReq generateOCSPRequest(X509Certificate issuerCert, BigInteger serialNumber) throws com.itextpdf.commons.bouncycastle.cert.ocsp.AbstractOCSPException, IOException, CertificateEncodingException, com.itextpdf.commons.bouncycastle.operator.AbstractOperatorCreationException
issuerCert - certificate of the issuesserialNumber - serial numberIOCSPReq an OCSP request wrappercom.itextpdf.commons.bouncycastle.cert.ocsp.AbstractOCSPException - is thrown if any errors occur while handling OCSP requests/responsesIOException - signals that an I/O exception has occurredCertificateEncodingException - is thrown if any errors occur while handling OCSP requests/responsescom.itextpdf.commons.bouncycastle.operator.AbstractOperatorCreationException - is thrown if any errors occur while handling OCSP requests/responsesprotected InputStream createRequestAndResponse(X509Certificate checkCert, X509Certificate rootCert, String url) throws IOException, com.itextpdf.commons.bouncycastle.operator.AbstractOperatorCreationException, com.itextpdf.commons.bouncycastle.cert.ocsp.AbstractOCSPException, CertificateEncodingException
InputStream.checkCert - X509Certificate certificate to get OCSP response forrootCert - X509Certificate root certificate from which OCSP request will be builturl - URL link, which is expected to be used to get OCSP response fromInputStreamIOException - if an I/O error occurscom.itextpdf.commons.bouncycastle.operator.AbstractOperatorCreationException - is thrown if any errors occur while handling OCSP requests/responsescom.itextpdf.commons.bouncycastle.cert.ocsp.AbstractOCSPException - is thrown if any errors occur while handling OCSP requests/responsesCertificateEncodingException - is thrown if any errors occur while handling OCSP requests/responsesCopyright © 1998–2024 Apryse Group NV. All rights reserved.