java - 使用 Jpedal 渲染包含视觉签名的 PDF 文档

标签 java pdf digital-signature jpedal

我正在使用 Jpedal(LGPL 版本 4.48b55)来渲染包含已激活视觉表示的签名的文档页面。然而,这些签名带有一个过度的问号和文本“签名未验证”。

如果我通过 Adob​​e Acrobat Reader 可视化该文件,我会看到一个绿色勾号和一条文字,说明“签名有效”(因为我在列表中包含了签名的证书颁发机构)。

有没有办法强制 jPedal 使用有效证书颁发机构列表来验证签名,从而使签名有效?

最佳答案

为了在 Java 中使用证书,您需要首先将其安装在 Java keystore 上。使用工具keytool提供Java运行时来完成此任务。

来自页面“The Most Common Java Keytool Keystore Commands”:

# Import New CA into Trusted Certs
keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias CA_ALIAS -keystore $JAVA_HOME/jre/lib/security/cacerts

如果您希望应用程序直接使用操作系统中的 keystore ,则必须为此指定一个与默认提供程序不同的特定提供程序。

From the documentation :

Keystore implementations are provider-based. More specifically, the application interfaces supplied by KeyStore are implemented in terms of a "Service Provider Interface" (SPI). That is, there is a corresponding abstract KeystoreSpi class, also in the java.security package, which defines the SPI methods that "providers" must implement.

还有:

There is a built-in default implementation, provided by Sun Microsystems. It implements the keystore as a file, utilizing a proprietary keystore type (format) named "JKS".

关于java - 使用 Jpedal 渲染包含视觉签名的 PDF 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9464973/

相关文章:

php - 使用 ECDSA P-256 SHA-256 使用 PHP 创建 JWT

java - 将消息和签名转换为 BouncyCaSTLe CMSSignedData 对象

java - Kotlin - 等同于对象的 SomeClass.class?

java - 如何在java中创建跨平台的安装程序

java - 如何在java GUI应用程序中显示PDF文件?

python - 使用 urllib urllib2 python 向 SciHub 发送表单请求不再有效

pdf - 如何使用 Google 的 Vision API 将 PDF(不可搜索)转换为可搜索 PDF?

javascript - 对于具有样式表处理指令的文档,XAdES 验证失败,引用 URI 为 =""

java - 为什么requestParameters的HashMap返回hashcode值

java - 使用 asyncTask 为 ListView 加载位图时出现 RejectedExecutionException