【发布时间】:2014-10-11 05:10:28
【问题描述】:
我正在尝试在我的 Web 应用程序中使用小程序来使用智能卡加密某些数据。 我正在关注这个链接: http://www.developer.com/java/other/article.php/3587361/Java-Applet-for-Signing-with-a-Smart-Card.htm
我能够读取存储在智能卡中的证书并使用证书加密数据。 但它需要我传递 PKCS#11 实现库文件(.dll) 的位置和智能卡引脚。
我的功能要求是从连接到系统的单个(或多个)智能卡加载证书列表,而不传递任何 .dll 文件路径。当然,当用户选择证书进行签名时,他/她将输入 PIN。
是否可以在不传递 PKCS#11 实现库文件 (.dll) 的位置的情况下从智能卡中提取证书详细信息
实施:
PKCS11LibraryFileAndPINCodeDialog localPKCS11LibraryFileAndPINCodeDialog = new PKCS11LibraryFileAndPINCodeDialog();
boolean bool;
try {
bool = localPKCS11LibraryFileAndPINCodeDialog.run();
}
finally
{
localPKCS11LibraryFileAndPINCodeDialog.dispose();
}
if (bool)
{
String str2 = this.mSignButton.getLabel();
this.mSignButton.setLabel("Working...");
this.mSignButton.setEnabled(false);
try
{
String str3 = localPKCS11LibraryFileAndPINCodeDialog.getLibraryFileName();
String str4 = localPKCS11LibraryFileAndPINCodeDialog.getSmartCardPINCode();
SmartCardSignerApplet.CertificationChainAndSignatureBase64 localCertificationChainAndSignatureBase641 = signDocument(arrayOfByte, str3, str4);
}
【问题讨论】:
标签: java dll certificate smartcard pkcs#11