hi
i have a remote server (linux) that contains servlets wich i want to use to
interact with an USB Aladdin eToken that the user connect in his local
machine (windows) to sing XML documents.
in the server i put (jdk1.5.0_03/jre/lib/security/java.security file):
security.provider.7=sun.security.pkcs11.SunPKCS11/usr/local/jakarta-tomcat/webapps/pkcs11.cnf
and the pkcs11.cnf contains:
name = AladdinEToken
library = /usr/local/jakarta-tomcat/webapps/libpkcs11.so
libpkcs11.so i took it from the opensc-0.9.6 instllation and i copied it in
that location.
when i execute this code in the server:
String configName = "/usr/local/jakarta-tomcat/webapps/pkcs11.cnf";
Provider p = new sun.security.pkcs11.SunPKCS11(configName);
i get the following error:
java.security.ProviderException: Initialization failed
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:175)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:76)
at Prueba3.doGet(Prueba3.java:46) <---- Provider p = new
sun.security.pkcs11.SunPKCS11(configName);
....
Caused by: java.io.IOException
at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:125)
at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:138)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:125)
... 37 more
if i made that works, would it work with this code?
KeyStore ks = KeyStore.getInstance("PKCS11");
String pin = "XXXXXX";
ks.load(null,pin.toCharArray());
since i locally in windows i have no problem
this aplication is directed only to windows users
am i in a good way? if i'm not, how can i implement it?
thank you beforehand
--
"Nada es imposible,
hasta que se demuestre lo contrario" - yo