PKCS11_MODULE path to a file

2.2k Views Asked by At

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

2

There are 2 best solutions below

0
On

At least the Nitrokey Pro can be used with opensc-pkcs11.so.

0
On

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:

For more information please look at these: