0

I have a YubiHSM2 HSM device and want to access it via PKCS11. I have installed the YubiHSM2 drivers as well as Libp11 and OpenSC tools.

However, when I try to connect and generate a key via:

pkcs11-tool --module 'C:\Users\myUser\yubihsm2-sdk\bin\yubihsm_pkcs11.dll --login --pin 0001password \
    --keypairgen --key-type rsa:2048 --label "my_key" --usage-sign

I receive:

error: Failed to laod pkcs11 module
Aborting.

I am thinking maybe I am adressing the dll file wrong? I am trying to implement this on Windows, I had it working on Unix System where I had to address a xxx.so file.

Does anyone have an idea or similar experience with a HSM module? Thanks for your help! Best regards LikeAKemper

J Jones
  • 3,060
  • 4
  • 26
  • 43
LikeAKemper
  • 155
  • 2
  • 12

1 Answers1

1

@everyone. I found the issue. It only works if I am already in the directory where the DLL is located. Now I am not sure why this is an issue for the command so let me know if you something about that. Anyway thank you.

LikeAKemper
  • 155
  • 2
  • 12
  • My guess is that `yubihsm_pkcs11.dll` depends on other libraries present in `C:\Users\myUser\yubihsm2-sdk\bin` dir. You can set that dir as a current dir (your solution) or you can add that dir to `PATH` environment variable. – jariq Mar 10 '18 at 17:15