FetchRevocationMaterial
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
Downloads validation material from an address a certificate names
Syntax
Delphi
Function TPDFlib.FetchRevocationMaterial(Const URL: WideString): AnsiString; Virtual;DLL
const char* DLFetchRevocationMaterial(int InstanceID, const wchar_t* URL, int* ByteCount);
const char* DLFetchRevocationMaterialA(int InstanceID, const char* URL, int* ByteCount);ActiveX
Function PDFlib::FetchRevocationMaterial(URL As String) As VariantParameters
| URL | An http, https or ldap address, typically one returned by GetCertificateCRLURLs or GetCertificateIssuerURLs |
|---|
Return values
| Material | The bytes exactly as served |
|---|---|
| Empty string | The download failed; GetTimeStampError carries the reason |
Remarks
The timeout is the one set by SetTimeStampOptions. Responses are capped at 8 MB, which is far above any real CRL, so a misconfigured endpoint cannot exhaust memory
An ldap:// address (RFC 4516) is read from the directory with an anonymous LDAPv3 bind and one search: the base, scope and presence or equality filter come from the URL, and the result is the first value of the first listed attribute the entry carries. Without an attribute list the CRL and CA certificate attributes (certificateRevocationList;binary, authorityRevocationList;binary, deltaRevocationList;binary, cACertificate;binary) are requested. Only plain LDAP is supported; referrals and search references to other ldap:// URLs are followed for up to four hops with the original attributes, scope and filter, a referral back to a server and entry already asked is not repeated, and a critical URL extension or a compound filter is rejected
Example
URLs:= PDF.GetCertificateCRLURLs(CertDER);
CRL:= PDF.FetchRevocationMaterial(Copy(URLs, 1, Pos(#13, URLs+ #13)- 1));