PDF Certification

Certify PDF documents

Use certification when the document should remain trusted but still allow a defined class of changes after signing.

Steps

  1. Create a PdfFileSignature instance and bind the source PDF.
  2. Build a PKCS7 signature object with the certificate and certificate password.
  3. Wrap that signature in a DocMDPSignature with the required DocMDPAccessPermissions value.
  4. Call certify with the target page, signature metadata, visible rectangle, and MDP signature.
  5. Save the certified PDF and close the facade object.

Java example

public static void certifyPdfWithMdpSignature(Path inputFile, Path certificateFile, Path outputFile) {
    PdfFileSignature pdfSignature = new PdfFileSignature();
    try {
        pdfSignature.bindPdf(inputFile.toString());
        DocMDPSignature signature = new DocMDPSignature(
                createPkcs7(certificateFile, "Certified for form filling and signing"),
                DocMDPAccessPermissions.FillingInForms);
        pdfSignature.certify(1, "Certified for form filling and signing", "security@example.com", "New York, USA", true, signatureRectangle(), signature);
        pdfSignature.save(outputFile.toString());
    } finally {
        pdfSignature.close();
    }
}