how to add blank page in digitally signed pdf using java?

后端 未结 2 1621
栀梦
栀梦 2020-11-22 04:59

I want to insert blank page at end of the digitally PDF using itext library.and my confusion is adding pages will invalidate the existing signatures? Thank you.

相关标签:
2条回答
  • 2020-11-22 05:25

    To put Joeri's answer into context, have a look at the Adobe technical white paper Adobe Acrobat 9 Digital Signatures, Changes and Improvements, especially its section "Allowed and disallowed changes." Here Adobe clarifies the allowed changes (as seen by Acrobat 9 and up) that can be made to a certified or signed document without invalidating the signatures applied to the document.

    Allowed actions for certified documents

    Certified with no changes allowed

    • Allowed
      • No changes allowed
    • Disallowed
      • Digitally signing
      • Supplying form field values
      • Adding or editing annotations
      • Adding form fields
      • Changing page content

    Certified with form fill-in and digital signatures allowed

    • Allowed
      • Supplying form field values
      • Digitally signing
    • Disallowed
      • Adding or editing annotations
      • Adding form fields
      • Changing page content

    Certified with annotations, form fill-in, and digital signatures, allowed

    • Allowed
      • Adding or editing annotations
      • Supplying form field values
      • Digitally signing
    • Disallowed
      • Adding form fields
      • Changing page content

    Allowed actions for signed but uncertified documents

    • Allowed
      • Adding signature fields (see Limitations on adding signature fields to signed but uncertified documents)
      • Adding or editing annotations
      • Supplying form field values
      • Digitally signing
    • Disallowed
      • Adding form fields other than signature fields
      • Changing page content

    As you see "Changing page content" always is in the "Disallowed" category. As adding a page changes page content — afterwards there is at least a white page where there used to be nothing —, this is not allowed.

    (Even though not explicitly mentioned here, instantiating page templates most likely also is allowed whenever form fill-ins are allowed as that would conform to the PDF standard, cf. ISO 32000-1 section 12.8.2.2.2. But making use of such page templates would at least require the document to be specially prepared before signing, and your question sounds like the documents are already signed without any such preparation...)

    PS: Obviously even these allowed changes need to be added in append mode aka incremental updates. Anything else will break the signature for good. For some backgrounds see this answer.

    0 讨论(0)
  • 2020-11-22 05:42

    Yes it will. The signature is based on the content that is signed, so if you change the content, the signature is no longer valid.

    If you're the signer, you can just sign the document again.

    Whether the pages you add are blank is irrelevant.

    0 讨论(0)
提交回复
热议问题