PDF电子签名ByteRange
PDF electronic signature ByteRange
我正在处理一些 PDF 文件,但找不到对此处发布的问题的明确解释。在数字签名的 PDF 文件上,我们有以下临时签名:
<< /Type /Sig /Filter /Adobe.PPKLite /SubFilter /adbe.pkcs7.detached/ByteRange[O1 L1 O2 L2] /Contents<0000....0000>
O1 = 偏移量 1(零)
L1 = 长度 1(签名前的内容长度)
O2 = 偏移量 2(L1 + 签名长度)
L2 = 长度2(签名后的内容长度)
我有这些问题:
1 - 内容 "hashed" 应包括“<”和“>”(在签名占位符的开头和结尾 0000....0000)?
2 - 签名长度是11742?这是否包括“<”和“>”?
3 - 在 ByteRange 上,第二个参数是从文件开头到“<”(在签名占位符 0000....0000 之前)或包括它的长度?与上一个问题相同,ByteRange 上的最后一个参数确实包含“>”字符(在签名占位符 0000....0000 的末尾)?
如果有人可以将我重定向到与此相关的技术手册,那将非常有帮助。
阅读技术手册并试用 PDF 后,我现在有了答案。
1 - The content to be "hashed" should include "<" and ">" (In the begin and the end of signature placeholder 0000....0000)?
不,“<”和“>”不应成为数据的一部分 "hashed/signed"。签名过程结束后,“<”和“>”应该用作十六进制签名的分隔符。示例:/Contents<3255....0000>
2 - The length of signature is 11742? Does this includes "<" and ">"?
没有必要。只要 "signature placeholder" 的长度比 signed 和 timestamped data.
3 - On the ByteRange the second parameter is the length from the beginning of file up to "<" (before signature placeholder 0000....0000) or including it? Same as on previous question, the last parameter on ByteRange does includes the ">" character (at the end of signature placeholder 0000....0000)?
第二个参数是“<”(签名占位符之前)的偏移量,或者同理,从文件开头到“<”的内容长度(不包含)
最后一个参数不包括“>”来计算剩余数据的长度。
mkl (https://whosebug.com/users/1729265/mkl)评论后的补充说明
O2 = offset 2 (L1 + signature length)
O2 = 偏移量 2 = L1 + 签名长度 + 2。这是因为占位符包括“<”和“>”
示例:
{100-BYTES-DATA-BEFORE}<0000....0000>{50-BYTES-DATA-AFTER}
数据为hashed/signed/timestamped
{100-BYTES-DATA-BEFORE} + {50-BYTES-DATA-AFTER}
签名占位符 = 11742 字节(11742 个零)
ByteRange[O 100 11844 50]
数据签名后and/or时间戳:
{100-BYTES-DATA-BEFORE} + < + 4321....0000 + > + {50-BYTES-DATA-AFTER}
我正在处理一些 PDF 文件,但找不到对此处发布的问题的明确解释。在数字签名的 PDF 文件上,我们有以下临时签名:
<< /Type /Sig /Filter /Adobe.PPKLite /SubFilter /adbe.pkcs7.detached/ByteRange[O1 L1 O2 L2] /Contents<0000....0000>
O1 = 偏移量 1(零)
L1 = 长度 1(签名前的内容长度)
O2 = 偏移量 2(L1 + 签名长度)
L2 = 长度2(签名后的内容长度)
我有这些问题:
1 - 内容 "hashed" 应包括“<”和“>”(在签名占位符的开头和结尾 0000....0000)?
2 - 签名长度是11742?这是否包括“<”和“>”?
3 - 在 ByteRange 上,第二个参数是从文件开头到“<”(在签名占位符 0000....0000 之前)或包括它的长度?与上一个问题相同,ByteRange 上的最后一个参数确实包含“>”字符(在签名占位符 0000....0000 的末尾)?
如果有人可以将我重定向到与此相关的技术手册,那将非常有帮助。
阅读技术手册并试用 PDF 后,我现在有了答案。
1 - The content to be "hashed" should include "<" and ">" (In the begin and the end of signature placeholder 0000....0000)?
不,“<”和“>”不应成为数据的一部分 "hashed/signed"。签名过程结束后,“<”和“>”应该用作十六进制签名的分隔符。示例:/Contents<3255....0000>
2 - The length of signature is 11742? Does this includes "<" and ">"?
没有必要。只要 "signature placeholder" 的长度比 signed 和 timestamped data.
3 - On the ByteRange the second parameter is the length from the beginning of file up to "<" (before signature placeholder 0000....0000) or including it? Same as on previous question, the last parameter on ByteRange does includes the ">" character (at the end of signature placeholder 0000....0000)?
第二个参数是“<”(签名占位符之前)的偏移量,或者同理,从文件开头到“<”的内容长度(不包含)
最后一个参数不包括“>”来计算剩余数据的长度。
mkl (https://whosebug.com/users/1729265/mkl)评论后的补充说明
O2 = offset 2 (L1 + signature length)
O2 = 偏移量 2 = L1 + 签名长度 + 2。这是因为占位符包括“<”和“>”
示例:
{100-BYTES-DATA-BEFORE}<0000....0000>{50-BYTES-DATA-AFTER}
数据为hashed/signed/timestamped
{100-BYTES-DATA-BEFORE} + {50-BYTES-DATA-AFTER}
签名占位符 = 11742 字节(11742 个零)
ByteRange[O 100 11844 50]
数据签名后and/or时间戳:
{100-BYTES-DATA-BEFORE} + < + 4321....0000 + > + {50-BYTES-DATA-AFTER}