Skip to main content

Module certify

Module certify 

Source
Expand description

§PDF Digital Certification

Certifies PDF files using X.509 certificates with PKCS#7 detached signatures. Uses incremental update to append signature objects without modifying the original PDF content.

§Two-Pass Approach

  1. Pass 1: Append signature dictionary (with placeholder /Contents), signature field widget, and updated catalog via PDF incremental update.
  2. Pass 2: Compute SHA-256 hash over the byte ranges excluding the placeholder, sign with RSA, build PKCS#7 SignedData, and write the DER-encoded signature into the placeholder.

Functions§

certify_pdf
Certify PDF bytes with an X.509 certificate, producing a valid digitally certified PDF.