I am trying to use an applet in my web application to encrypt some data using a smart card. i am following this link: http://www.developer.com/java/other/article.php/3587361/Java-Applet-for-Signing-with-a-Smart-Card.htm
I am able to read the certificates stored in the smartcard and encrypt data using the certificates. But it requires me to pass location of PKCS#11 implementation library file(.dll) and the smart card pin.
My functional requirement is to load the list of certificates from a single(or multiple) smart cards connected to a system without passing any .dll filepath. Ofcourse, when the user selects a certificate for signing he/she will enter the PIN.
Is it possible to extract certificate details from a smartcard without passing location of PKCS#11 implementation library file(.dll)
Implementation:
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);
}