Skip to content

using pkcs11-provider with OpenSSL #504

Answered by simo5
embetrix asked this question in Q&A
Discussion options

You must be logged in to vote

I believe the following should work:

openssl pkeyutl -sign -in data.txt -out signature.bin -provider pkcs11   \
    -inkey "pkcs11:object=testRSAKey;type=private?pin-value=12345" \
    -provider pkcs11 -provider-path /usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so \
    -propquery "provider=pkcs11"

note that the various provider option are sensitive to the order they are passed in.

Whil;e this can give you access to the module, you won't be able to set any pkcs11-provider configuration options, if your usage require any of them (and softhsm2 being very buggy might) you will have to revert to use the openssl config file.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by embetrix
Comment options

You must be logged in to vote
5 replies
@simo5
Comment options

@embetrix
Comment options

@beldmit
Comment options

beldmit Jan 22, 2025
Collaborator

@simo5
Comment options

@simo5
Comment options

Comment options

You must be logged in to vote
1 reply
@beldmit
Comment options

beldmit Jan 23, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants