SetTimeStampServerA

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 0, an empty string or False 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 SetTimeStampServer and string arguments are interpreted using the current SetAnsiMode code page

Selects the RFC 3161 time-stamp authority the built-in client talks to

Syntax

Delphi

Function DLSetTimeStampServerA(InstanceID: Integer; URL: PAnsiChar; UserName: PAnsiChar; Password: PAnsiChar): Integer;

DLL

int DLSetTimeStampServerA(int InstanceID, const char* URL, const char* UserName, const char* Password);

Parameters

URLThe authority endpoint; must be an http or https address
UserNameBasic authentication user name, or an empty string for an anonymous authority
PasswordBasic authentication password

Return values

1The setting was stored

Remarks

The address is validated when a request is actually sent, so a scheme other than http or https is reported through GetTimeStampError rather than raising

Pair this with SetTimeStampOptions to choose the digest algorithm and whether the authority should embed its signing chain in the token

Example

PDF.SetTimeStampServer('https://tsa.example.com/tsa', '', '');
PDF.SetTimeStampOptions(2, 1, 1, 15000, '');

See also

SetTimeStampOptions, FetchTimeStampToken, ApplyPAdESSignatureTimeStamp