HPDFCMSSignPDFStreamWithProvider
Signs an existing PDF signature placeholder through a callback, remote, hardware or application-defined provider
Declaration
function HPDFCMSSignPDFStreamWithProvider(InputStream, OutputStream: TStream;
const CertificateDER: TBytes; Provider: THPDFSignatureProvider;
const KeyIdentifier: AnsiString; const Options: THPDFCMSSignOptions;
CancellationToken: THPDFCancellationToken): Boolean;
The overload without CancellationToken uses the same behaviour and the function preserves the existing CMS placeholder budget checks
InputStream must contain the /ByteRange and /Contents placeholders emitted by a signed signature field
Options.DigestAlgorithm selects SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-384 or SHA3-512 for the byte ranges, signed attributes, provider request and optional timestamps
The function copies through a bounded 256 KB buffer, seek-patches fixed-width placeholders, and may use the same seekable readable/writable stream for input and output without retaining a complete second PDF
When an attached PDF MAC selects the same digest, the signing path reuses the byte-range digest from the shared streaming scan