I recently bought one NitroHSM2 to use is with my Java App.
I need to perform AES Keygen, Encrypt and Decrypt on the HSM, so I installed make install the sc-hsm-embedded pkcs11 so library.
But when I start my App with library path = /usr/local/lib/libsc-hsm-pkcs11.so and slot = 0 I got this error
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_SLOT_ID_INVALID
at sun.security.pkcs11.wrapper.PKCS11.C_GetSlotInfo(Native Method) ~[jdk.crypto.cryptoki:?]
at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:370) ~[jdk.crypto.cryptoki:?]
I don’t know what to do …
It work well with opensc pkcs11 library, I can connect to the HSM and do supported operations (only asymmetric ones)
I also enabled pkcs11 debug. I can provide pkcs11 library log if need.
Please help me, I really need to get this working.