PdfSigner
Digital signature SCAFFOLD (T-84): the prepare-then-sign flow that stages a signature field, computes the exact /ByteRange, and embeds a caller-supplied CMS blob. The library does NO cryptography: the DER SignedData comes from the application (JVM apps can build one with java.security; that is their code, not ours).
val editor = doc.edit()
val signer = PdfSigner(doc, editor)
signer.prepareSignature("Signature1")
val target = signer.saveForSigning()
val cms = myPkcs7Detached(target.bytes, target.byteRange) // app-side crypto
val signed = PdfSigner.embedSignature(target.bytes, target.byteRange, cms)Content copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Serialize incrementally, locate the /Contents placeholder, patch the /ByteRange in place (space-padded to the reserved width so no offset moves), and return the bytes plus the range: [0, start] and [end, size-end] cover the whole file except the hex string itself.