Class PdfSigner


  • public final class PdfSigner
    extends java.lang.Object
    Public entry point of the PD4ML PDF signing API.

    Applies a PKCS#7/CMS ("PAdES-compatible") digital signature to a PDF document as a raw incremental update, built entirely on the pd4ml com.pd4ml.pdf.cos object model/parser (no PDFBox, no other PDF library) plus BouncyCastle for the CMS/PKCS#7 cryptography. Supports invisible and visible signatures, PDF "certification" (DocMDP), and optional RFC 3161 timestamping.

    Thread-safety: a PdfSigner instance holds no mutable state and may be reused/shared across threads; each sign(...) call is independent.

    Example

    
     CertificateUtils.SigningIdentity identity =
             CertificateUtils.loadFromPkcs12(new File("signer.p12"), "password".toCharArray());
    
     SigningOptions options = new SigningOptions()
             .setReason("Approved")
             .setSignerName("Jane Doe");
    
     new PdfSigner().sign(new File("input.pdf"), new File("signed.pdf"), identity, options);