API referenceDigital Signatures

pdfSetSigTimeStampUrl

Arm an RFC-3161 timestamp authority URL so that the NEXT

C
BOOL32 __stdcall pdfSetSigTimeStampUrlA(PPDF IPDF, const char* TSAUrl);
BOOL32 __stdcall pdfSetSigTimeStampUrlW(PPDF IPDF, const wchar_t* TSAUrl);
Delphi
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.

ParameterDescription
IPDFDocument handle.
TSAUrlThe 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Digital Signatures
Category

Setters

Exported names

pdfSetSigTimeStampUrlW pdfSetSigTimeStampUrlA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.