关于要更改的提供商的设置,您能给我更多建议吗?
我可以在PKCS11KeyStoreKeyingDataProvider.java中看到以下内容:
public class PKCS11KeyStoreKeyingDataProvider extends KeyStoreKeyingDataProvider
{
/**
*
* @param nativeLibraryPath the path for the native library of the specific PKCS#11 provider
* @param providerName this string is concatenated with the prefix SunPKCS11- to produce this provider instance's name
* @param certificateSelector the selector of signing certificate
* @param keyStorePasswordProvider the provider of the keystore loading password (may be {@code null})
* @param entryPasswordProvider the provider of entry passwords (may be {@code null})
* @param returnFullChain indicates of the full certificate chain should be returned, if available
* @throws KeyStoreException
*/
public PKCS11KeyStoreKeyingDataProvider(
final String nativeLibraryPath,
final String providerName,
SigningCertSelector certificateSelector,
KeyStorePasswordProvider keyStorePasswordProvider,
KeyEntryPasswordProvider entryPasswordProvider,
boolean returnFullChain) throws KeyStoreException
{在我的SignerTTest.java中:
PKCS11KeyStoreKeyingDataProvider ptccKeyingDataProv = new PKCS11KeyStoreKeyingDataProvider
("D:\\pteidpkcs11.dll",
"pteidpkcs11",
new FirstCertificateSelector(), null, null, false);但是我不明白,通常我会下载合适的.DLL,所以这里的库pteidpkcs11.dll位于D:(所以在java中我把"\“:"D:"\"pteidpkcs11.dll")
在我把.dll的名字放在这里之后,pteidpkcs11作为参数。
在"new FirstCertificateSelector()“之后,将选择密钥库列表中的第一个证书,不是吗?
第一个空是密钥库提供程序的密码,不是吗?
第二个空是证书的密码,不是吗?
那么returnFullChain到底是什么角色呢?
我想知道如何配置提供商的信息,因为我在搜索过程中暂时还不清楚。
谢谢,
威廉。
发布于 2012-09-06 00:59:41
新的FirstCertificateSelector()将选择密钥库列表中的第一个证书,不是吗?
是。您可以传入SigningCertSelector接口的任何其他实现。
第一个null是密钥库提供程序的密码,不是吗?第二个空是证书的密码,不是吗?
是。它为空,因为特定PKCS#11提供程序处理密钥存储条目(它是具有PIN码的智能卡)的保护。
和returnFullChain它的作用到底是什么?
密钥库中的条目可以包含密钥和与完整证书链相关联的证书。此参数控制getSigningCertificateChain方法是返回完整链还是仅返回叶证书。
适当的配置和动态链接库将取决于您使用的PKCS11提供程序。在那次测试中,我使用了一张葡萄牙公民卡和一个智能卡读卡器。请注意,PKCS11KeyStoreKeyingDataProvider只是基于sun的PKCS11提供程序的java密钥库的适配器。
https://stackoverflow.com/questions/12284142
复制相似问题