FetchOCSPResponseA
Digital signatures
Requires the Enterprise edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibEnterprise (unit PDFlibEnterprise); the Enterprise DLL and ActiveX builds provide it unchanged; other editions keep the method, which returns an empty string and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to FetchOCSPResponse and string arguments are interpreted using the current SetAnsiMode code page
Asks an OCSP responder for the status of a certificate and returns the reply
Syntax
Delphi
Function DLFetchOCSPResponseA(InstanceID: Integer; SubjectCertDER: PAnsiChar; SubjectCertDERLength: Integer; IssuerCertDER: PAnsiChar; IssuerCertDERLength: Integer; ResponderURL: PAnsiChar; ByteCount: PInteger): PAnsiChar;
DLL
const char* DLFetchOCSPResponseA(int InstanceID, const char* SubjectCertDER, int SubjectCertDERLength, const char* IssuerCertDER, int IssuerCertDERLength, const char* ResponderURL, int* ByteCount);
ActiveX
Function PDFlib::FetchOCSPResponse(SubjectCertDER As Variant, IssuerCertDER As Variant, ResponderURL As String) As VariantParameters
| 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);