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

MessageDigestHexHex digest of the data being stamped. Its length must match the algorithm set by SetTimeStampOptions.

Return values

TokenThe TimeStampToken as DER bytes.
Empty stringThe 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