API reference › Digital Signatures
pdfSetSigTimeStampUrl
Arm an RFC-3161 timestamp authority URL so that the NEXT
BOOL32 __stdcall pdfSetSigTimeStampUrlA(PPDF IPDF, const char* TSAUrl);
BOOL32 __stdcall pdfSetSigTimeStampUrlW(PPDF IPDF, const wchar_t* TSAUrl);
function pdfSetSigTimeStampUrlA(const IPDF: PPDF; const TSAUrl: PAnsiChar): LongBool; stdcall;
function pdfSetSigTimeStampUrlW(const IPDF: PPDF; const TSAUrl: PWideChar): LongBool; stdcall;
Purpose. Arm an RFC-3161 timestamp authority URL so that the NEXT pdfCloseAndSignFile / pdfCloseAndSignFileEx call signs AND time-stamps the document in one save (PAdES-T style signature time stamp).
Description. Sign-or-timestamp used to be an either/or choice: pdfCloseAndSignFile produced an approval signature, and pdfAddDocTimeStamp produced a standalone DocTimeStamp — each closes the file itself, so they could not be combined. With a URL armed here, the signing pipeline gains one extra stage: after the detached CMS signature is produced, the signature VALUE bytes are hashed (SHA-256), sent to the TSA as an RFC-3161 request, and the returned TimeStampToken is embedded into the CMS as the unsigned attribute id-aa-signatureTimeStampToken (OID 1.2.840.113549.1.9.16.2.14). Because the token lives OUTSIDE the signed attributes, the signature itself remains byte-for-byte valid and verifiable. The /Contents placeholder is automatically widened to make room for the token (the TSA ships its certificates inside it). The arm is one-shot: it is consumed by the signing call and also cleared by starting a new document. Passing NULL or an empty string clears a pending arm.
If the TSA cannot be reached, rejects the request, or returns no token, the SAVE FAILS — the engine never silently writes an unstamped signature when a time stamp was requested.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
TSAUrl | The RFC-3161 timestamp authority's HTTP(S) URL, or NULL/empty to clear a pending arm. |
Return value. True once the arm (or clear) is recorded; False only for an invalid document handle. Network activity happens later, inside the signing call.
See also. pdfCloseAndSignFile, pdfAddDocTimeStamp (standalone document time stamp without a signature), pdfVerifySignature.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetSigTimeStampUrlW
pdfSetSigTimeStampUrlA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.