【发布时间】:2016-12-23 07:34:34
【问题描述】:
我有由 esig/dss https://github.com/esig/dss library 签名的 PDF 文档。我可以在 Acrobat Reader 中看到该签名。当我想用 iText 和 BouncyCastle 验证它时,我遇到了异常:
2.16.840.1.101.3.4.2.1withRSA Signature not available
我在 Fedora 上使用 Oracle JDK 1.8.0_112 和无限加密 iText-2.0.8.jar 和 BouncyCastle bcprov-jdk16-139.jar。
当我使用来自Complete list of MessageDigest available in the JDK的响应检查我的环境中可用的消息摘要时
我明白了:
Alias: "OID.2.16.840.1.101.3.4.2.1" -> "SHA-256"
所以它在我的 JDK 中可用。
为什么2.16.840.1.101.3.4.2.1withRSA Signature not available?
【问题讨论】:
-
请分享一个示例文件。
-
说了这么多,我才知道你提到了"iText-2.0.8.jar"和"bcprov-jdk16-139.jar"。这些版本是古老的,从那时起有许多与签名相关的标准发生了变化,甚至是新引入的。另一方面,Esig/dss 是最新的并且特别针对新标准。因此,更新,更新,更新!我会回答的。
标签: pdf cryptography itext signature