sign
Signs pdfBytes using a caller-supplied CMS signing callback. No BouncyCastle dependency is involved on PdfKmp's side.
Return
the signed PDF bytes (original content + incremental signature).
Parameters
the PDF to sign.
optional signer name written into the signature dictionary.
optional human-readable reason for signing.
optional signing location.
produces the DER-encoded CMS/PKCS#7 detached signature over the bytes it is handed (the document's signed byte range). The input is the content to sign; the output is the SignedData.
Convenience overload that builds the CMS signature with BouncyCastle from a KeyStore entry. Requires org.bouncycastle:bcpkix-jdk18on on the runtime classpath — see the class KDoc. Prefer the callback-based sign for production where the key lives in an HSM or a signing service.
Return
the signed PDF bytes.
Parameters
the PDF to sign.
key store holding the signing key + certificate chain.
entry alias of the private key.
password protecting the key entry.
optional human-readable reason for signing.
optional signing location.