Set up Pico HSM for the first time, choose PIN or Public Key Authentication (PKA), and learn the main ways to use the device.
Use these programs to manage Pico HSM:
- OpenSC: probably it is the most known and it allows to interface the device via PKCS11 specifications. It provides the commands pkcs11-tool and pkcs15-tool.
- OpenSSL: it allows the use of external devices for deploying a Public Key Infrastructure (PKI) to set up a Certificate Authority.
- SmartCard Shell 3: it is a tool provided by CardContact.de with a friendly interface. It provides the most advanced features and it is necessary to use expert components.
Initialization
Initialize Pico HSM the first time you boot it. The package includes pico-hsm-tool.py.
To initialize Pico HSM for the first time, run:
$ python3 pico-hsm-tool.py initialize
The tool generates a new MKEK and device key, then uploads a device certificate signed by an external CA. Before reinitializing the device with pico-hsm-tool or another app, unlock it with the PIN or SO-PIN. Otherwise, the existing MKEK and device key cannot be recovered; pico-hsm-tool must generate new ones.
Initialization sets a default PIN and SO-PIN. You can later initialize the device with your preferred app, but first unlock it with either PIN. If you skip this step, the device key is erased and you must initialize the device again with pico-hsm-tool.
Change PIN and SO-PIN
The SO-PIN is the administrative PIN; use it only if the regular PIN is lost. It is an eight-character alphanumeric string and defaults to “57621880“. In terminal commands, enter it in hexadecimal as 3537363231383830 (16 digits).
The SO-PIN has 15 attempts. After 15 incorrect attempts, the device is permanently locked.
Use OpenSC’s pkcs11-tool to change the PIN or SO-PIN.
To change the SO-PIN:
$ pkcs11-tool --login --login-type so --so-pin 3537363231383830 --change-pin --new-pin 0123456789012345
The PIN is a variable-length numeric code that unlocks the device. You use it for almost all cryptographic operations.
To change the PIN:
$ pkcs11-tool --login --pin 648219 --change-pin --new-pin 123456
You have three attempts to enter the PIN. After three incorrect attempts, it locks and must be unblocked with the SO-PIN.
To unblock the PIN:
$ pkcs11-tool --login --login-type so --so-pin=3537363231383830 --init-pin --new-pin=648219
