FetchRevocationMaterialA

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 FetchRevocationMaterial and string arguments are interpreted using the current SetAnsiMode code page

Downloads validation material from an address a certificate names

Syntax

Delphi

Function DLFetchRevocationMaterialA(InstanceID: Integer; URL: PAnsiChar; ByteCount: PInteger): PAnsiChar;

DLL

const char* DLFetchRevocationMaterialA(int InstanceID, const char* URL, int* ByteCount);

ActiveX

Function PDFlib::FetchRevocationMaterial(URL As String) As Variant

Parameters

URLAn http, https or ldap address, typically one returned by GetCertificateCRLURLs or GetCertificateIssuerURLs

Return values

MaterialThe bytes exactly as served
Empty stringThe 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));

See also

AddPAdESDSSCRLFromURL, AddPAdESDSSCertificateFromURL