如何使用java在数字签名的pdf中添加空白页? [英] how to add blank page in digitally signed pdf using java?

查看:46
本文介绍了如何使用java在数字签名的pdf中添加空白页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 itext library 在数字 PDF 的末尾插入空白页.我的困惑是添加页面会使现有签名无效?谢谢.

解决方案

要了解 Joeri 的答案,请查看 Adob​​e 技术白皮书 Adobe Acrobat 9 数字签名、更改和改进,尤其是其部分允许和不允许的更改."此处 Adob​​e 阐明了允许的更改(如 Acrobat 9 及更高版本所见)可以对经过认证或签名的文档进行的更改,而不会使应用于文档的签名无效.><块引用>

允许对认证文件采取的行动

已认证,不允许更改

允许

  • 不允许更改

不允许

  • 数字签名
  • 提供表单字段值
  • 添加或编辑注释
  • 添加表单域
  • 更改页面内容

通过表格填写和数字签名进行认证

允许

  • 提供表单字段值
  • 数字签名

不允许

  • 添加或编辑注释
  • 添加表单域
  • 更改页面内容

通过注释、表格填写和数字签名进行认证,允许

允许

  • 添加或编辑注释
  • 提供表单字段值
  • 数字签名

不允许

  • 添加表单域
  • 更改页面内容

允许对已签名但未经认证的文件采取行动

允许

  • 添加签名字段(请参阅将签名字段添加到已签名但未认证的文档的限制)
  • 添加或编辑注释
  • 提供表单字段值
  • 数字签名

不允许

  • 添加签名字段以外的表单字段
  • 更改页面内容

如您所见更改页面内容"总是在不允许"中类别.由于添加页面会更改页面内容 - 之后至少有一个白页,以前什么都没有 - 这是不允许的.

(即使这里没有明确提及,只要允许表单填写,也很可能允许实例化页面模板,因为这符合 PDF 标准,参见 ISO 32000-1 第 12.8.2.2.2 节.但使用此类页面模板至少需要签署前要特别准备的文件,你的问题听起来像是没有任何准备的文件已经签署了......)

PS:很明显,即使这些允许更改也需要以追加模式(即增量更新)添加.其他任何事情都会永久破坏签名.对于某些背景,请参阅此答案.

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.

解决方案

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.

这篇关于如何使用java在数字签名的pdf中添加空白页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆