具有多个 DSS 词典的 Pades 签名

Pades Signature with multiple DSS Dictionaries

我正在处理 PDF Signer/Validator,但不知道应该如何处理具有多个签名和 dss 词典的 pdf 文件。

场景如下:一个pdf文件被签名两次,在第二次签名后,添加了一个DSS字典,其中包含两次签名的CRLs、CERTs和OCSPs:

[ Signature 1 ]
[ Signature 2 ]
DSS << 
    VRI << 
        /HashSignature1 10 0 R
        /HashSignature2 11 0 R
    >>
    ...
>>

到目前为止,还不错。文件中唯一的 DSS 词典涵盖了这两个签名。但是其他人决定签署同一份文件,并添加他的 CRL 和其他所有内容。然后,我必须创建一个新的 DSS 字典,我的问题是:旧的签名,已经包含在另一个 DSS 字典中,必须在这个字典中吗?我想是的,因为 DSS 在一个更新的文档目录中(并且你删除了对最后一个词典的引用),但是公司内部几乎没有达成一致。

[ Signature 1 ]
[ Signature 2 ]
DSS << 
    VRI <<
        /HashSignature1 10 0 R
        /HashSignature2 11 0 R
    >>
    ...
>>
[ Signature 3 ]
DSS << 
    VRI <<
        /HashSignature1 10 0 R
        /HashSignature2 11 0 R
        /HashSignature3 16 0 R
    >>
    ...
>>

[ Signature 1 ]
[ Signature 2 ]
DSS << 
    VRI <<
        /HashSignature1 10 0 R
        /HashSignature2 11 0 R
    >>
    ...
>>
[ Signature 3 ]
DSS << 
    VRI <<
        /HashSignature3 16 0 R
    >>
    ...
>>

他们都正确吗?只有其中之一?有一个?

由于目录字典中只有一个 DSS 条目,您需要更新现有的 DSS 字典(分别是 VRI 字典和其他值)。

来自 Adob​​e 的 Andrea Valle 通过电子邮件为我澄清了这一点:

This has been discussed within ESI for some time, and finally the team decided to clarify this in EN 319 142-1.

See section 5.4.1 on page 11 of version 1.1.0:

The life-time of the protection can be further extended beyond the life-time of the last document time-stamp applied by adding further DSS information to validate the previous last document time-stamp along with a new document time-stamp. Every time a DSS Dictionary is updated during incremental update, it should contain the values from the previous DSS Dictionary.

NOTE: In general the DSS Dictionary will contain validation data from previous revisions plus validation data added for the current revision. If entries are removed from a DSS Dictionary during an incremental update the set of validation data might not be complete for validation of the signatures, but replacement of validation data - like e.g. more up-to-date certificate status information - might be performed for optimization reasons.

所以实际上建议添加旧版 DSS 词典中的所有条目,但不是强制。如果这些条目不破坏签名,您可以更新这些条目,但这是可选的。

进一步阅读同一文档:

The Document Security Store (DSS) shall be a dictionary that shall have the value DSS as key in the document catalog dictionary. This dictionary is used to provide a single place where all of the validation-related information for some or all signatures in the document should be placed.

DSS 旨在提供一个单一 位置,所有 信息应该 放置.

因此,如果您没有将所有信息都放在那里,您并没有破坏任何东西,但您没有按预期使用 DSS。

那么,答案是:pdf 签名者应该使用第一种方法,但 pdf 验证器应该为第二种方法准备。


编辑:

实际上,任何 PAdES 验证器都应该检查 DSS 条目是否存在。如果您只检查最新的,则可以重新验证无效的签名,如果用于签署 CRL 或 OCSP 的 CA 证书后来被破坏,并且在最新的 DSS 中添加了此虚假信息。

示例:

  1. Sig 1 是使用已撤销的证书制作的
  2. DSS条目全部添加,签名肯定无效
  3. 添加了 DocumentTimeStamp,保护此 DSS。

  4. Sig 1 CA 证书被泄露

  5. Sig 2 已制作,证书有效

  6. 添加了 Sig 2 DSS 条目,LTV 启用签名
  7. Sig 1 CRL/OCSP 被替换为使用受感染的 CA 证书制作的假冒证书

在这种情况下,依赖最新 DSS 的验证器将在不应该验证 Sig 1 时进行验证。这就是您添加 DocumentTimeStamp 以保护有关该签名的信息的原因。


长话短说:

两个选项都对。 DSS 应该有关于所有签名的信息,但这不是强制性的。验证者应该检查签名后立即制作的 DSS,而不仅仅是最新的。