disig / SoftHSM2-for-Windows

SoftHSM2 installer for MS Windows
Other
84 stars 22 forks source link

Could not load the PKCS#11 library/module: LoadLibraryA failed: 0x0000007E #11

Closed stephenbriley closed 5 years ago

stephenbriley commented 5 years ago

Hi, I've installed SoftHSM 2.5.0 on a windows 2016 server. The installation completes with no errors but when I attempt to run the following command: C:\SoftHSM2\bin>softhsm2-util.exe --init-token --slot 0 --label "My token 1"

The following error appears: ERROR: Could not load the PKCS#11 library/module: LoadLibraryA failed: 0x0000007E ERROR: Please check log files for additional information.

I have the softhsm2.conf located in the C:\SoftHSM2\bin directory. It has the following data in the config file.

directories.tokendir = .\tokens objectstore.backend = file log.level = INFO slots.removable = false

Any ideas on what i'm doing wrong? Thanks, Steve

jariq commented 5 years ago

This is what MSI installer does:

This is what softhsm2-util.exe does:

  1. Resolves path to configuration file using SOFTHSM2_CONF environment variable
  2. Loads PKCS#11 library softhsm2.dll without specifying its full path so the linker resolves its location using the values from PATH environment variable

The error you are getting - LoadLibraryA failed: 0x0000007E - indicates that softhsm2-util.exe cannot load/locate softhsm2.dll so I guess that modification of PATH environment variable performed by MSI installer is not reflected in your session yet. Try logging out of Windows and logging back in.

jariq commented 5 years ago

@stephenbriley any news on this?

Manucci85 commented 5 years ago

Hi @jariq

I installed the portable version on win10 and I succeed to show my slots

directories.tokendir = ..\var\softhsm2\tokens\ objectstore.backend = file log.level = INFO slots.removable = false

SOFTHSM2_CONF == c:\dev\softhsm\etc\softhsm2.conf

(grosso merdo)

path == %path% + c:\dev\softhsm\lib + %SOFTHSM2_CONF%

result:

C:\dev\softhsm\bin>softhsm2-util.exe --show-slots Available slots: Slot 0 Slot info: Description: SoftHSM slot ID 0x0 Manufacturer ID: SoftHSM project Hardware version: 2.5 Firmware version: 2.5 Token present: yes Token info: Manufacturer ID: SoftHSM project Model: SoftHSM v2 Hardware version: 2.5 Firmware version: 2.5 Serial number: Initialized: no User PIN init.: no Label:

edan81 commented 3 years ago

in my issue, I solve it by installing microsoft visual c++ 2015 redistributable 2019 x64.