I'm trying to connect to firefox's PKCS#11 implementation using the new sun 
PKCS#11 Provider.

My code looks like:

String configName = "c:\\pkcs11.config";
Provider p = new sun.security.pkcs11.SunPKCS11(configName);
Security.addProvider(p);

My pkcs11.config is:

name = Firefox
library = C:\Mozilla\softokn3.dll

And I always got the error:

Exception in thread "main" java.security.ProviderException: Initialization 
failed
 at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:153)
 at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:74)
 at Main.main(Main.java:15)
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ARGUMENTS_BAD
 at sun.security.pkcs11.wrapper.PKCS11.C_Initialize(Native Method)
 at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:143)
 at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)

Does anyone know what is wrong? Or where can I found a solution?

Thanks,

Enzo Motta. 


_______________________________________________
mozilla-crypto mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to