FetchOCSPResponse
Digital signatures
Description
Asks an OCSP responder for the status of a certificate and returns the reply.
Syntax
Delphi
Function TPDFlib.FetchOCSPResponse(Const SubjectCertDER, IssuerCertDER: AnsiString; Const ResponderURL: WideString): AnsiString;Parameters
| SubjectCertDER | The certificate whose status is being asked about, DER encoded. |
|---|---|
| IssuerCertDER | The certificate that issued it, DER encoded. |
| ResponderURL | The responder address, or an empty string to use the one the subject certificate names in its Authority Information Access extension. |
Return values
| Response | The OCSPResponse bytes, ready for the document security store. |
|---|---|
| Empty string | The exchange failed or the responder did not answer successful; GetTimeStampError carries the reason. |
Remarks
Only a successful response is returned. A responder that answered tryLater or unauthorized sent an error report, not a status answer, and storing it would leave a validator parsing the wrong structure.
The timeout is the one set by SetTimeStampOptions.
Example
Response:= PDF.FetchOCSPResponse(SignerCert, IssuerCert, '');
if Response= '' then
ShowMessage(PDF.GetTimeStampError);