SetTimeStampOptions

Digital signatures

Description

Sets the hash algorithm, certificate request, nonce use, timeout and requested policy for the time-stamp client.

Syntax

Delphi

Function TPDFlib.SetTimeStampOptions(DigestAlgorithm, RequestCertificates, UseNonce, TimeoutMS: Integer; Const PolicyOID: WideString): Integer;

Parameters

DigestAlgorithm1 = SHA-1, 2 = SHA-256 (the default), 3 = SHA-384, 4 = SHA-512.
RequestCertificatesNon-zero asks the authority to embed its signing chain in the token, which long-term validation needs.
UseNonceNon-zero sends a fresh random nonce and rejects a token that does not echo it.
TimeoutMSTimeout for each network phase; 0 selects 30 seconds.
PolicyOIDDotted-decimal policy the authority should apply, or an empty string to let it choose.

Return values

1The settings were stored.
0DigestAlgorithm is outside 0..4.

Remarks

The digest length is checked against the selected algorithm before anything is sent, so a 20-byte digest submitted with SHA-256 selected fails locally with a clear message instead of coming back as a generic authority rejection.

Leaving the nonce enabled is what makes a replayed response detectable: RFC 3161 requires the token to carry the nonce back, and a mismatch aborts the exchange.

See also

SetTimeStampServer, FetchTimeStampToken, GetTimeStampStatus