Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in Initialization #113

Open
foryougautam opened this issue Oct 15, 2024 · 1 comment
Open

Issue in Initialization #113

foryougautam opened this issue Oct 15, 2024 · 1 comment

Comments

@foryougautam
Copy link

foryougautam commented Oct 15, 2024

Issue in initialization I am testing SoftHSM2

const pkcs11js = require('pkcs11js');
try {
const pkcs11 = new pkcs11js.PKCS11();
pkcs11.load('C:\SoftHSM2\lib\softhsm2-x64.dll');
pkcs11.C_Initialize();
const slots = pkcs11.C_GetSlotList(true);
console.log("Available slots:", slots);

pkcs11.C_Finalize();

} catch (error) {
console.error("PKCS#11 Error:", error);
}
Error I am getting `Pkcs11Error: CKR_GENERAL_ERROR

poc\node_modules\pkcs11js\index.js:77:22)\n' +
' at Object. (C:\Users\Gautam Bishwas\Documents\ssc2\aes-hsm-poc\test-connection.js:6:8)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1358:14)\n' +
' at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)\n' +
' at Module.load (node:internal/modules/cjs/loader:1208:32)\n' +
' at Module._load (node:internal/modules/cjs/loader:1024:12)\n' +
' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)\n' +
' at node:internal/main/run_main_module:28:49',
code: 5
}`

@microshine
Copy link
Contributor

It seems the error is coming from the provider being used. It's likely that SoftHSM is not configured properly, or the configuration file might be missing. To understand the issue, you should enable logging on the SoftHSM side and check SoftHSM logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants