I have an applet for digital signature. My problem is that initialize the keystore, but it remains open until you close the browser. How do I ask the pin every time I want to sign?
This is the initialization code:
/* Se obtiene el proveedor del contenedor de claves */
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);
//Cargo el proveedor de la CIPE
providerPKCS11 = new SunPKCS11(configStream1);
Security.addProvider(providerPKCS11);
ks = KeyStore.getInstance("PKCS11", providerPKCS11);
ks.load(null, null);
Can anyone tell me how to fix it? Thank you.