Time-stamps the whole document and writes the time-stamped file to stream: the document's file followed by
an incremental update holding a document timestamp, whose byte ranges cover the whole file except the token.
public void Timestamp(Stream stream, PdfTimestampClient timestampClient, string? fieldName = null)
Where to write, from its current position. It is not disposed.
The client of the time-stamp authority; the request is sent synchronously.
The fully qualified name of an unsigned signature field to hold the timestamp, or of a new invisible one;
null (the default) creates a new field named SignatureN.
ISO 32000-2 §12.8.5.2 and §12.8.1, Table 255; RFC 3161 as updated by RFC 5816; ETSI EN 319 142-1 (the document timestamp of
PAdES B-LTA). The timestamp goes into a signature field as for Sign(Stream, IPdfSigner, PdfSignatureOptions?) (§12.8.5.2: "The existence of one or more
document timestamps shall be determined by examining signature fields"); its value is a document timestamp dictionary with
Type DocTimeStamp, Filter Adobe.PPKLite, SubFilter ETSI.RFC3161, a ByteRange
over the whole file except Contents, and none of the entries Table 255 says not to use with ETSI.RFC3161
(M, Name, Reason, Location, ContactInfo, Cert, Reference, Changes).
The byte ranges are hashed with DigestAlgorithm, the hash is sent to the authority, and the
TimeStampToken it returns, once checked against the request, is written into Contents, padded with zeros.
Document timestamps are PDF 2.0: the update raises the version (in the catalog), or strict mode refuses before anything changes.
An encrypted document is updated with its own key. When it has, or its permissions require, an integrity MAC, the new MAC is
attached to the token's signer as its pdfMacData unsigned attribute, digesting the byte ranges and the token's signature
value, and the trailer's AuthCode points at the document timestamp dictionary (ISO/TS 32004 §6.5.2, §6.6.3).
Once the last byte is written the document reads from the time-stamped file. If the authority fails, nothing is written and the document is left as it was, as a failed signer leaves it (Sign(Stream, IPdfSigner, PdfSignatureOptions?)): every object, including what the save inside time-stamping changed before the authority was asked. A mutation: no read may run concurrently with it.