Python 3 + SoftHSM2 + PyKCS11
10K+
Python 3 version of Diogo Monica's original Golang + SoftHSM2 image found here: https://hub.docker.com/r/diogomonica/golang-softhsm2/
This version adds Ludovic Rousseau's excellent PyKCS11 tools in order to do PKCS11-related development, in Python.
For more information on using the PyKCS11 API, go here: https://pkcs11wrap.sourceforge.io/api/
To download and invoke run the following:
$ docker pull bruienne/pykcs11_softhsm2
$ docker run -it <other runtime options> bruienne/pykcs11_softhsm2
This will drop into a bash prompt from which development can continue. To test, run the following commands:
$ softhsm2-util --init-token --slot 0 --label test --pin 1234
=== SO PIN (4-255 characters) ===
Please enter SO PIN: ****
Please reenter SO PIN: ****
The token has been initialized and is reassigned to slot <some number that is not actually 0>
$ /usr/src/PyKCS11/samples/getinfo.py
cryptokiVersion: 2.40
flags:
libraryDescription: b'Implementation of PKCS11 '
libraryVersion: 2.3
manufacturerID: b'SoftHSM '
Available Slots: 2 [<some number>, 1]
Slot n.: <some number>
firmwareVersion: b'2.03'
flags: CKF_TOKEN_PRESENT
hardwareVersion: b'2.03'
manufacturerID: b'SoftHSM project '
slotDescription: b'SoftHSM slot ID 0x<some hex> '
SessionInfo
flags: CKF_SERIAL_SESSION
slotID: <some number>
state: 0
ulDeviceError: 0
<snip>
Content type
Image
Digest
Size
175.7 MB
Last updated
about 9 years ago
docker pull bruienne/pykcs11_softhsm2