Native RFC3161 timestamps
HPDFHeadlessTimestamp provides native OpenSSL 3 request creation and authenticated RFC3161 response and token verification on Linux and Windows
HPDFSignHeadlessCMS, SignToFile, and SignPFXToFile hash the actual CMS signature octets with SHA-256 and attach the verified response token as the signatureTimeStampToken unsigned attribute
Configure THPDFHeadlessCMSOptions.Timestamp.TrustedCAFile and Transport before signing, and set RequireTimestamp when an authenticated token is mandatory
Options := THPDFHeadlessCMSOptions.Default;
Options.TrustedCAFile := SignerTrustFile;
Options.RequireTimestamp := True;
Options.Timestamp.TrustedCAFile := TSATrustFile;
Options.Timestamp.TrustedCRLFile := TSACRLFile;
Options.Timestamp.RequireRevocation := True;
Options.Timestamp.Transport := RequestTimestamp;
Options.Timestamp.TransportContext := TransportContext;
Report := Document.SignPFXToFile(FieldIndex, OutputFile, IdentityPFX,
IdentityPassword, Options);
The caller-owned transport receives a complete DER TimeStampReq and returns a complete DER TimeStampResp, allowing the caller to control HTTP authentication, TLS policy, deadlines, and cancellation during network I/O
Requests contain fresh cryptographic nonces and request the TSA certificates; responses must match both the request nonce and the supplied signature value
Verification authenticates the complete CMS token, checks the TSA certificate path and critical timestamp EKU, verifies ESS signing-certificate binding, and checks the SHA-256, SHA-384, or SHA-512 messageImprint against the actual signature octets using the algorithm carried by TSTInfo
RequireRevocation loads the explicit CRL file and enables issuer-verified certificate revocation checks; missing, expired, or revoked evidence fails rather than producing a trusted result
Existing tokens can be verified offline without the original request nonce; fresh response verification additionally checks the original request nonce and response status
Callbacks that already provide an imprint
The ForImprint functions accept a precomputed SHA256, SHA384, or SHA512 digest and its THPDFHeadlessTimestampDigest value, then preserve those exact digest bytes in the RFC3161 request without hashing them again
Use these functions when a signing callback already supplies the messageImprint, including the Windows THPDFCMSTimestampCallback; the raw-signature request helpers continue to use SHA256, whilst offline token verification hashes the original signature octets with the actual supported TSTInfo algorithm
Token := HPDFRequestHeadlessTimestampForImprint(MessageImprint,
htdSHA384, TimestampOptions);
The imprint length must be 32, 48, or 64 bytes for the selected digest; request-bound verification additionally checks the original fresh nonce, digest OID, CMS signature, TSA certificate binding, explicit trust roots, EKU, and configured revocation evidence
See request creation, response verification, offline token verification, transport, and digest values
Trusted certificate and CRL validity is evaluated at verification time, so an archived token whose TSA certificate has expired needs an archival validation policy and evidence rather than bypassing current trust checks
Malformed tokens, duplicate timestamp attributes, mismatched imprints, unknown roots, invalid EKUs, expired TSA certificates, revoked TSA certificates, expired CRLs, response budgets, and cancellation are covered by native and independent acceptance tests
Timestamp verification reports are separate from document signer certificate trust; a signature timestamp does not authenticate later unsigned PDF revisions
Timestamp functions load their OpenSSL timestamp symbols only when used; set HOTPDF_OPENSSL_LIBRARY to an explicit matching-architecture OpenSSL 3 shared library when needed