2

I'm using Jpedal (LGPL version 4.48b55) to render the pages of a document containing signatures with visual representation activated. However, those signatures appear with an overimposed question mark and the text "Signature Not Verified".

If I and visualize the file through Adobe Acrobat Reader, I get a green tick and a text saying the "signature is valid" (since I included the certificate authority of the signatures in the list).

Is there any way to force jPedal to validate the signatures with a list of valid certificate authorities, so it renders the signatures as valid?

4

1 回答 1

2

为了在 Java 中使用证书,您需要首先在 Java 密钥库中安装它。使用Java 运行时提供的工具keytool来完成此任务。

从“最常见的 Java Keytool Keystore 命令”页面:

# 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 提供的应用程序接口是根据“服务提供者接口”(SPI) 实现的。即有一个对应的抽象 KeystoreSpi 类,也在 java.security 包中,它定义了“提供者”必须实现的 SPI 方法。

并且:

Sun Microsystems 提供了一个内置的默认实现。它使用名为“JKS”的专有密钥库类型(格式)将密钥库实现为文件。

于 2012-02-27T18:04:36.743 回答