FetchTimeStampToken
Digital signatures
Description
Obtains an RFC 3161 TimeStampToken for a digest from the configured authority.
Syntax
Delphi
Function TPDFlib.FetchTimeStampToken(Const MessageDigestHex: AnsiString): AnsiString;Parameters
| MessageDigestHex | Hex digest of the data being stamped. Its length must match the algorithm set by SetTimeStampOptions. |
|---|
Return values
| Token | The TimeStampToken as DER bytes. |
|---|---|
| Empty string | The exchange failed; GetTimeStampError carries the reason. |
Remarks
The token is returned exactly as the authority produced it, so it can be attached with SetPAdESSignatureTimeStampToken, used as a document time-stamp, or stored for an audit trail.
For the common case of time-stamping a signature that was just written, ApplyPAdESSignatureTimeStamp does the hashing, the fetch and the attachment in one call.
Example
Token:= PDF.FetchTimeStampToken(PDF.GetPAdESSignatureValueHashHex(ProcessID));
if Token= '' then
ShowMessage(PDF.GetTimeStampError);See also
SetTimeStampServer, SetTimeStampOptions, ApplyPAdESSignatureTimeStamp, GetTimeStampError