I am trying to use softhsm for my project using java 1.8-64bit.
I am trying with m first sample java class given here Connecting to SoftHSM java code
I was able to install softhsm softhsm2-windows installer.
And Also able to create token usng softhsm-util.exe tool.
but when I try to run the java code I am getting
Exception in thread "main" java.security.ProviderException: Initialization failed
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:376)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
at SoftHSM.main(SoftHSM.java:44)
Caused by: java.io.IOException: The specified module could not be found.
Z:/SOFTHSM_INSTALL/lib/softhsm2-x64.dll
at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:138)
at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:151)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:313)
... 2 more
Even though the file is available in right location as mentioned in exception.
Please help to solve this issue.
Updated System Visual C++ installed: