Table of Contents

Class OcspClientBouncyCastle

Namespace
iText.Signatures
Assembly
itext.sign.dll

OcspClient implementation using BouncyCastle.

public class OcspClientBouncyCastle : IOcspClient
Inheritance
OcspClientBouncyCastle
Implements
Inherited Members

Constructors

OcspClientBouncyCastle()

Creates new OcspClientBouncyCastle instance.

public OcspClientBouncyCastle()

OcspClientBouncyCastle(OCSPVerifier)

Creates OcspClient.

[Obsolete("starting from 8.0.5. OcspClientBouncyCastle() should be used instead. If required, iText.Commons.Bouncycastle.Asn1.Ocsp.IBasicOcspResponse can be checked using iText.Signatures.Validation.V1.OCSPValidator class.")]
public OcspClientBouncyCastle(OCSPVerifier verifier)

Parameters

verifier OCSPVerifier

will be used for response verification.

Methods

CreateRequestAndResponse(IX509Certificate, IX509Certificate, string)

Create OCSP request and get the response for this request, represented as Stream.

protected virtual Stream CreateRequestAndResponse(IX509Certificate checkCert, IX509Certificate rootCert, string url)

Parameters

checkCert IX509Certificate

iText.Commons.Bouncycastle.Cert.IX509Certificate certificate to get OCSP response for

rootCert IX509Certificate

iText.Commons.Bouncycastle.Cert.IX509Certificate root certificate from which OCSP request will be built

url string

System.Uri link, which is expected to be used to get OCSP response from

Returns

Stream

OCSP response bytes, represented as Stream

GenerateOCSPRequest(IX509Certificate, IBigInteger)

Generates an OCSP request using BouncyCastle.

protected static IOcspRequest GenerateOCSPRequest(IX509Certificate issuerCert, IBigInteger serialNumber)

Parameters

issuerCert IX509Certificate

certificate of the issues

serialNumber IBigInteger

serial number

Returns

IOcspRequest

iText.Commons.Bouncycastle.Cert.Ocsp.IOcspRequest an OCSP request wrapper

GetBasicOCSPResp(IX509Certificate, IX509Certificate, string)

Gets OCSP response.

public virtual IBasicOcspResponse GetBasicOCSPResp(IX509Certificate checkCert, IX509Certificate rootCert, string url)

Parameters

checkCert IX509Certificate

the certificate to check

rootCert IX509Certificate

parent certificate

url string

to get the verification

Returns

IBasicOcspResponse

iText.Commons.Bouncycastle.Asn1.Ocsp.IBasicOcspResponse an OCSP response wrapper

Remarks

Gets OCSP response. If OCSPVerifier was set, the response will be checked.

GetCertificateStatus(byte[])

Retrieves certificate status from the OCSP response.

protected static ICertStatus GetCertificateStatus(byte[] basicOcspRespBytes)

Parameters

basicOcspRespBytes byte[]

encoded basic OCSP response

Returns

ICertStatus

good, revoked or unknown certificate status retrieved from the OCSP response, or null if an error occurs.

GetEncoded(IX509Certificate, IX509Certificate, string)

public virtual byte[] GetEncoded(IX509Certificate checkCert, IX509Certificate rootCert, string url)

Parameters

checkCert IX509Certificate
rootCert IX509Certificate
url string

Returns

byte[]