SetTimeStampServer
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
Selects the RFC 3161 time-stamp authority the built-in client talks to
Syntax
Delphi
Function TPDFlib.SetTimeStampServer(Const URL, UserName, Password: WideString): Integer; Virtual;ActiveX
Function PDFlib::SetTimeStampServer(URL As String, UserName As String, Password As String) As LongDLL
int DLSetTimeStampServer(int InstanceID, const wchar_t* URL, const wchar_t* UserName, const wchar_t* Password);
int DLSetTimeStampServerA(int InstanceID, const char* URL, const char* UserName, const char* Password);Parameters
| URL | The authority endpoint; must be an http or https address |
|---|---|
| UserName | Basic authentication user name, or an empty string for an anonymous authority |
| Password | Basic authentication password |
Return values
| 1 | The 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