signPdf
signPdf(
cred):Promise<Uint8Array<ArrayBufferLike>>
Defined in: src/pdf/signature.ts:173
Sign a PDF that already carries a signature placeholder (from
addSignaturePlaceholder). Computes the real /ByteRange, hashes the
covered bytes (SHA-256), builds the detached PKCS#7/CMS, and writes it into
the reserved /Contents hole — leaving every other byte untouched.
Parameters
Section titled “Parameters”Uint8Array
The placeholder-bearing PDF bytes.
The signer’s certificate, key and algorithm.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
A new byte array with the real ByteRange and signature spliced in.
Throws
Section titled “Throws”Error when no placeholder is found, it is malformed, WebCrypto is
unavailable, or the signature exceeds the reserved /Contents size.