【问题标题】:the signature includes en embedded timeStamp but it could not be verified签名包含嵌入式时间戳,但无法验证
【发布时间】:2013-07-24 04:16:51
【问题描述】:

我刚刚在我的 pdf 中添加了时间戳。签名有效。时间戳记号也是正确的(我已经检查过了)。但 adobe reader 告诉我 “签名包含嵌入的时间戳,但无法验证”。

AttributeTable unsigned = signerInformation.getUnsignedAttributes();
Hashtable<ASN1ObjectIdentifier, Attribute> unsignedAttrHash = null;
if (unsigned == null) {
    unsignedAttrHash = new Hashtable<ASN1ObjectIdentifier, Attribute>();
} else {
    unsignedAttrHash = signerInformation.getUnsignedAttributes().toHashtable();
}

unsignedAttrHash.put(PKCSObjectIdentifiers.id_aa_signatureTimeStampToken, signatureTimeStamp);

SignerInformation newSignertInformation = SignerInformation.replaceUnsignedAttributes(si, new AttributeTable(unsignedAttrHash));

我找到this code at stackowerflow. 它有效。这真的是正确的代码。最后我有新的 SignerInformationStore 和新的 CMS 签名数据,像这样

CMSSignedData.replaceSigners(oldCMSSignedData, newSignerStore);

但也许我的 PDF 中缺少某些内容?证书之类的?

that's sample pdf

【问题讨论】:

  • 嗨!我正在努力解决您遇到的同样问题。您能否向我解释一下,您向时间戳服务发送了什么样的数据来检索正确的消息印记?谢谢!

标签: pdf digital-signature bouncycastle pdfbox adobe-reader


【解决方案1】:

签名时间戳中的消息印记似乎不正确。预计此消息印记中签名值的SHA256。

签名值的SHA256:

1b4532052d612ca32ae96b9a8e7aa6d64ae6c69dc00e1b7b31394ac3b54c4049

时间戳记令牌中的消息印记:

E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 

【讨论】:

  • 好的。我会看看这是否是解决方案。 :-) P.S 你用什么软件看的?
  • 我是 Cryptolog 的员工,我使用我们的软件 Serenity 来验证签名。
  • 我有类似的问题,但无法理解解决方案
  • @Ibrahim 您必须首先从您的数字签名提供程序 API 或您使用的任何内容中获取字节范围摘要的签名,然后您需要对该签名进行 SHA256 消化并将其作为摘要发送用于时间戳请求。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-27
  • 1970-01-01
  • 1970-01-01
  • 2019-10-31
  • 1970-01-01
  • 2013-02-14
相关资源
最近更新 更多