Public Key Authentication (PKA) lets a user authenticate without entering a PIN (see Notes). During authentication, Pico HSM sends a challenge to a device holding an authorized private key and verifies the returned signature.
- A Pico HSM #A contains a private key, whose public key will be used for authentication.
- The public key of #A is registered into a second Pico HSM #B.
- When a user wants to login into #B, #B generates a challenge that is passed to #A for signature.
- #A signs the challenge and returns the signature.
- #B verifies the signature against the challenge with the public key of #A, previously registered.
- If the signature is valid, #B grants access to the user.
Initialize the device before enabling PKA. If it already stores secret or private keys, export them first and reimport them after setup.
Usage
Patch SCS3 before using it. For details, see the scs3.patch.txt and the SCS3 guide.
Generate the authentication key
On a secondary device, generate a private key, on the ECC 256 bits (brainpoolP256r1 or secp256r1). Label it with an easy name, such as “Authentication”.

Once finished, export the public key.

Initialization
Initialize the primary device. When asked to choose an authentication mechanism, select “Public Key Authentication”.


Register the exported public key. On success, the device displays 0 authenticated public key(s) in 1 of 1 scheme.


Authentication
Connect the secondary device that holds the private key. Do not load it in SCS3. Then start public-key authentication.

Select the secondary card and its Authentication private key, or the label you assigned to the key.

Enter the secondary device’s PIN.
If the private key matches the registered public key, the primary device grants access and displays User PIN authenticated (9000) even though you did not enter a PIN.
From now on, you have full access and can operate normally with the primary device.
Notes on MKEK
Pico HSM uses the PIN to protect the MKEK, which in turn protects private and secret keys. With PKA enabled, a successful public-key authentication grants authenticated privileges without a PIN. The PIN remains optional.
We recommend combining PKA with a PIN. When both are configured, PKA grants authenticated privileges while the PIN unlocks Pico HSM’s MKEK internally. Unlock the MKEK with PIN verification before using private or secret keys; otherwise, login may succeed while those keys remain unavailable.
Neither the MKEK nor private or secret keys are stored in plaintext. A flash dump alone does not let an attacker decrypt them.
You can initialize the device with both PKA and a PIN using SCS3 or OpenSC:
Note: do not import any DKEK share or DKEK operation before PKA and PIN setup.
With OpenSC
Use this command, or a similar one, to configure both the PIN and PKA:
sc-hsm-tool -X --so-pin 1234567890123456 --pin 648219 -K 1 -n 1 -s 1
This enables both PIN and PKA, with the MKEK protected.
With SCS3
SCS3 cannot initialize the device with PKA and PIN at the same time. Configure them in separate steps:
- Initialize the device with PKA. When done, the PIN will not be initialized but it will advice that 3 attemps can be performed.
- There is NO default PIN. So, DO NOT attempt to log in yet. A reset PIN shall be requested.
- Click on
Reset User-PIN, introduce the SO-PIN configured during the initialization and introduce the desired User-PIN.
When done, the device will be configured with PIN and PKA.
