Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PKCS11_MODULE path to a file

I am working on a test program using the Nitrokey HSM:

import pkcs11

lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
token = lib.get_token(token_label='smartcard')
    with token.open() as session:

print(session)

Question: what can be the pkcs11 library file name? I guessed opensc-hsm.so, and defined PKCS11_MODULE to that path, but was not successful. So, what can be the name of a pkcs11 library to be loaded? Thanks

like image 428
Anoy Avatar asked Nov 17 '25 03:11

Anoy


1 Answers

According to this pkcs11 page on Nitrokey HSM, the standard OpenSC module can be used:

The OpenSC PKCS #11 module is opensc-pkcs11.so.

Alternative is to use the HSM smart card vendor's module libsc-hsm-pkcs11.so:

  • Code: https://github.com/CardContact/sc-hsm-embedded
  • Documentation: https://github.com/CardContact/sc-hsm-embedded/wiki/PKCS11

For more information please look at these:

  • https://github.com/OpenSC/OpenSC/wiki/SmartCardHSM
  • https://www.smartcard-hsm.com/opensource.html
  • https://www.smartcard-hsm.com/support.html
like image 134
szszsz at Nitrokey Avatar answered Nov 19 '25 17:11

szszsz at Nitrokey