9

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.

KhAn SaAb
  • 5,248
  • 5
  • 31
  • 52

2 Answers2

20

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.

mkl
  • 90,588
  • 15
  • 125
  • 265
  • Just an addition: if the blank page is added in append mode, the byte range of the signature is not modified, so the signature is correct from a cryptographic view. Another question is the disallowed changes that Adobe added from Acrobat version 9 that mkl has explained. So Adobe would consider this signature as invalid. – Egl Jan 11 '17 at 16:29
  • Does signing multiple times a document by creating new signature fields after the first signature count as "Adding form fields"? i.e. when using one of the certified modes only the signature fields present at the time of doc creation can be filled in a (valid) document? – Luca Leonardo Scorcia Mar 29 '23 at 20:49
  • @Luca *"Does signing multiple times a document by creating new signature fields after the first signature count as "Adding form fields"?"* - It used to count as such in the early days, i.e. at least in Acrobat 9. I think the interpretation has been softened so far that nowadays new signature fields can be added whenever signing is allowed. – mkl Mar 30 '23 at 05:22
3

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.

Joeri Hendrickx
  • 16,947
  • 4
  • 41
  • 53
  • @NK123 that does not matter. See MKLs answer for a list of allowed changes. It's basically not allowing anything on the content. – Joeri Hendrickx May 23 '13 at 11:38