PS
i try to use this
String pkcs11ConfigFile = "c:\\pkcs11.cfg";
Provider pkcs11Provider =
new sun.security.pkcs11.SunPKCS11(pkcs11ConfigFile);
Security.addProvider(pkcs11Provider);
where pkcs11.cfg contain
name = SmartCard
library = C:\WINDOWS\system32\sadaptor.DLL
but when i try to execute it i get next error
Exception in thread "main" java.security.ProviderException: Initialization failed
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:175)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:76)
at Main.addSunPkcsProvider(Main.java:16)
at Main.main(Main.java:24)
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_GENERAL_ERROR
at sun.security.pkcs11.wrapper.PKCS11.C_Initialize(Native Method)
at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:144)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:125)
... 3 more
Java Result: 1