-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Hi,
I am a newbie to SoftHSM/PKCS 11. I am trying to:
Step 1
- Initialize the SoftHSM module
- Login to access the token/slot
- Obtain the
session - Encrypt a message using the
session'sciphermethods as described in your README documentation - Persist the encrypted value in a file/database
Step 2
- Restart the application
Step 3
- Initialize the SoftHSM module
- Read the encrypted value from the file/database
- Login to access the token/slot
- Obtain the
session - Attempt to decrypt the encrypted message using the
session'sciphermethods as described in your README documentation
Though I am able to login successfully using the same token and seem to obtain the same session, I run into the following error when performing Buffer.concat([dec, decipher.final()]).toString();
[Pkcs11Error: CKR_GENERAL_ERROR] {
relayer_1 | method: 'crypto_final',
relayer_1 | nativeStack: ' at Error (native) crypto_final:710',
relayer_1 | code: 5
relayer_1 | }
From what I understand about the PKCS 11 Session as described in the spec, unless a session is closed/logged out the application should be able to access the same session and hence the token/slot.
Appreciate any direction, inputs and help on this one. Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels