TPDFlibDocTimeStampTokenEvent
Data types, security and signatures
Description
TPDFlibDocTimeStampTokenEvent is the procedural type of the callback that supplies an RFC 3161 TimeStampToken during document timestamp signing.
The library computes the digest over the final signed byte range and calls the handler; the returned DER token is hex-encoded into the signature /Contents.
Assign it to TPDFlibSignProcess.DocTimeStampTokenProvider, or through TPDFlibSigner.SetDocTimeStampTokenProvider on the signer API. The paired sender object is passed back as Sender.
Syntax
Delphi
TPDFlibDocTimeStampTokenEvent = Function(Sender: TObject;
Const Digest: AnsiString): AnsiString Of Object;Parameters
| Sender | The object stored alongside the callback; the library does not interpret it |
|---|---|
| Digest | Digest over the final /ByteRange bytes, using the resolved digest algorithm |
Return values
| AnsiString | DER-encoded RFC 3161 TimeStampToken; an empty result aborts the signing operation |
|---|
Remarks
Document timestamp signing implies passthrough: no private key is used by the library, and the callback owns the TSP request and its transport.
The token is written into the reserved /Contents space; when SetDocTimeStamp is given a non-positive length it reserves 8192 bytes, and a larger token fails instead of being truncated.
The digest is produced after the final ByteRange has been written, so the token binds the exact bytes that will be signed.
An empty result or a token that does not fit aborts the process with an error result.
See also
SetSignProcessDocTimeStamp, FetchTimeStampToken, TPDFlibSigner, VerifyDocumentTimeStampEx