I have an applet for digital signing. My problem is that the keystore is initialized, but it remains open until the browser closes. How can I request a pin every time I want to sign?
This is the initialization code:
pkcs11config = "name=Athena\nlibrary=C:\\Windows\\system32\\asepkcs.dll";
byte[] pkcs11configBytes1 = pkcs11config.getBytes();
ByteArrayInputStream configStream1 = new ByteArrayInputStream(pkcs11configBytes1);
BouncyCastleProvider providerBC = new BouncyCastleProvider();
Security.addProvider(providerBC);
providerPKCS11 = new SunPKCS11(configStream1);
Security.addProvider(providerPKCS11);
ks = KeyStore.getInstance("PKCS11", providerPKCS11);
ks.load(null, null);
Can someone tell me how to fix this? Thank.
source
share