Apply a cryptographic digital signature to a (report) PDF, as an alternative to the
print-sign-scan workflow, and verify it. signPDFLM signs the PDF bytes with the
signer's private key (RSA or EC) using SHA-256 and writes a detached signature
sidecar <pdf>.sig (and, by default, the signer's public key
<pdf>.pubkey.pem). verifyPDFLM confirms, with the signer's public key
or certificate, that the PDF is byte-for-byte intact and was signed by that key
(tamper-evidence and non-repudiation). These functions require the openssl
package.
This is a detached signature (a separate .sig file), not a PAdES
signature embedded inside the PDF; embedding a visible in-viewer signature requires a
dedicated PDF tool (e.g. Adobe Acrobat or pyhanko). The detached signature is
cryptographically equivalent for integrity and non-repudiation.