YubiHSM
Description
YubiHSM is the most integrated HSM workflow in Stream Offline CA.
The appliance provides middleware installation, connection checks, object listing, KSP backup, and KSP restore workflows.
After middleware installation, the top-level YUBI menu becomes available.
The YubiHSM backup and restore workflows protect YubiHSM KSP material.
They complement the Stream backup and restore procedures, but they do not replace them.
The YubiHSM runtime menu is separated from the generic Stream backup and restore menu so YubiHSM connection, object listing, KSP backup, and KSP restore remain explicit HSM actions.
PKCS#11 slot discovery is centralized in PKCS11 > DISCOVERY, not in the YubiHSM-specific menu.
Compatibility scope
The appliance integrates the YubiHSM shell, connector, setup workflow, shared library, and PKCS#11 configuration. Select approved middleware and qualify the device, firmware, authentication policy, and ceremony before production use.
Pre-requisites
-
YubiHSM device
-
Approved YubiHSM middleware packages
-
Approved authentication key IDs and passwords
-
Stream Offline CA booted in
CreateorRestore -
Removable media for backup shares and
.yhwfiles when required -
Stream PKCS#11 keystore values approved for the operation.
Values to confirm
| Value | Purpose | Record in the ceremony report |
|---|---|---|
YubiHSM middleware packages |
Provide the approved shell, connector, setup, shared library, and PKCS#11 configuration. |
Package identifiers and hashes. |
Connector address |
Allow the YubiHSM shell and PKCS#11 module to reach the device. |
Non-secret address and port only. |
Authentication key ID |
Authenticate:
|
Key ID only, never the password. |
PKCS#11 library path |
Configure the Stream PKCS#11 keystore. |
Library path, usually |
Backup share count and threshold |
Define YubiHSM backup custody. |
|
Install middleware
-
Connect the YubiHSM device when instructed.
-
On
tty1, openHSM > INSTALL. -
Select
YUBI. -
Let the appliance install the YubiHSM shell, connector, setup tool, shared libraries, and PKCS#11 configuration.
-
Confirm that the
YUBImenu appears.
The appliance expects yubihsm-setup, yubihsm-shell, and /etc/yubihsm_pkcs11.conf to be available after installation.
When these components are detected, the appliance exposes the top-level YUBI menu.
YUBI menu
| Action | Description |
|---|---|
|
Opens a YubiHSM session through the connector and verifies authentication. |
|
Lists YubiHSM objects and displays details such as:
|
|
Runs the YubiHSM KSP backup workflow. It can:
|
|
Restores YubiHSM KSP keys from |
Use PKCS11 > DISCOVERY > PROVIDER-SLOTS, then select YUBI, when the operator needs to list YubiHSM PKCS#11 slots before configuring the Stream keystore.
Workflow map
Use the YUBI workflows around the Stream operation they support.
Create a YubiHSM-backed CA
-
Install the YubiHSM middleware from
HSM > INSTALL. -
Run
YUBI > CONNECTto confirm that the connector, device, session ID, and session password are usable. -
Run
PKCS11 > DISCOVERY > PROVIDER-SLOTS > YUBIto confirm visible PKCS#11 slots. -
Run
YUBI > KEYSto confirm the visible objects before Stream creates or uses CA key material. -
Configure the Stream PKCS#11 keystore with the approved YubiHSM library path, slot, user type, and PIN.
-
Create or import the CA material in Stream.
-
Run
YUBI > KEYSagain to confirm that the expected private-key object is visible. -
Run
YUBI > BACKUPafter the key ceremony so the YubiHSM KSP material can be restored later. -
Store the Stream backup material and the YubiHSM backup material under the same operation record.
Restore a YubiHSM-backed CA
-
Boot the target Stream Offline CA runtime.
-
Install the YubiHSM middleware from
HSM > INSTALL. -
Restore the Stream state first with the approved Stream backup procedure.
-
Wait until Stream is active and reachable.
-
Run
YUBI > RESTOREwith the approved.yhwdirectory and required restore shares. -
Edit the Stream YubiHSM keystore PIN when the restore completion screen reports the imported authentication key IDs.
-
Run
YUBI > KEYSand verify that the expected object IDs, labels, algorithms, and domains are present. -
Validate the managed CA operation in Stream before resuming production use.
Routine control
-
Run
YUBI > CONNECTwhen the operator needs to prove that the device and connector are reachable. -
Run
YUBI > KEYSbefore and after a key ceremony, restore, or troubleshooting session. -
Run
YUBI > BACKUPafter YubiHSM key material changes. -
Keep YubiHSM
.yhwfiles, recovery kits, and shares in the same operation record as the corresponding Stream backup.
Connection check workflow
YUBI > CONNECT is the quickest readiness check.
It does not create Stream CA material and does not back up the HSM.
-
Open
YUBI > CONNECT. -
Confirm the session ID. The default is
1, and hexadecimal values such as0x0001are accepted when required. -
Enter the YubiHSM session password.
-
Let the appliance start or reach the connector and open a YubiHSM shell session.
-
Treat the workflow as successful only when the appliance reports the created session ID.
-
If the workflow fails, record the displayed reason, exit code, and
yubi-open.logpath.
Record the session ID and the validation result. Do not record the session password.
Object inventory workflow
YUBI > KEYS opens a session and lists visible YubiHSM objects.
Use it to confirm that Stream is pointing at the expected HSM material.
-
Open
YUBI > KEYS. -
Confirm the session ID.
-
Enter the YubiHSM session password.
-
Review the object list.
-
Open each relevant object detail view.
-
Compare the displayed label, ID, type, domains, capabilities, delegated capabilities, algorithm, origin, and sequence with the ceremony record.
Record only non-secret identifiers. For CA records, the key object ID, label, algorithm, and domain assignment are usually sufficient.
Configure the Stream keystore
-
Switch to the Stream UI on
tty2. -
Open Keystores and keys.
-
Add a
PKCS#11keystore. -
Enter the YubiHSM PKCS#11 library path approved for the operation. The expected path is
/usr/local/lib/pkcs11/yubihsm_pkcs11.so. -
Parse the library.
-
Select the approved slot and user type.
-
Enter the approved PIN for the active YubiHSM authentication key.
-
Save the keystore.
-
Verify that Stream can list or create the expected key.
|
Do not record real YubiHSM session passwords, authentication key passwords, application key passwords, audit passwords, or PIN values. Use placeholders in public operation reports. |
Back up YubiHSM material
Run this workflow after the initial YubiHSM-backed CA key ceremony, after a YubiHSM key change, or before a runtime migration where the target environment must recover the same YubiHSM KSP material.
The YubiHSM KSP backup is separate from the Stream configuration or database backup.
The operation must produce its own .yhw files, shares, and recovery kit.
-
Open
YUBI > BACKUP. -
Enter the approved authentication password for the backup operation.
-
Enter or confirm the wrap key ID.
-
Enter the total number of shares. The accepted range is
2to10. -
Enter the privacy threshold. The threshold must be greater than
1and less than or equal to the total share count. -
Enter or confirm the application authentication key ID and password.
-
Enter or confirm the audit authentication key ID and password.
-
Review the summary screen.
-
Select
LAUNCH. -
Wait for the backup helper to complete and display the generated wrap, application, and audit authentication key IDs.
-
Distribute generated shares to USB media when the operation requires separate custody.
-
Export generated
.yhwfiles and the recovery kit to approved media. -
Choose
DONEonly when the generated files must intentionally remain in the appliance backup directory for the next controlled step.
The appliance validates middleware availability, helper script availability, key IDs, share count, threshold, and password length before launching the backup.
Password prompts are hidden and are not described as pre-filled.
When the dump helper creates the .yhw files, the appliance compares the backup directory state before and after the helper run and includes only new or modified .yhw files in the follow-up export and recovery kit.
In USB mode, the appliance copies generated .yhw files and the recovery kit to USB media and removes the local generated copy after verified export.
In DONE mode, generated .yhw files and the recovery kit remain under /opt/offline_ca/backup.
Record the following non-secret values:
-
Wrap key ID
-
Application authentication key ID
-
Audit authentication key ID
-
.yhwfilenames -
Recovery kit filename
-
File sizes and SHA-256 hashes
-
Share count and threshold
-
Share filenames, media labels, and custodians
-
Backup date and target appliance image version
Never record application passwords, audit passwords, authentication passwords, PIN values, or Shamir share values.
Restore YubiHSM material
Run this workflow only after the Stream runtime state has been restored and Stream is active. The appliance blocks YubiHSM restore when Stream is not reachable, because the restored YubiHSM authentication key values must be synchronized back into the Stream keystore.
-
Open
YUBI > RESTORE. -
Open the connector when the appliance offers to run
YUBI > CONNECT. -
Mount USB media when the
.yhwfiles or restore shares are stored on removable media. -
Select the directory containing the approved
.yhwfiles. -
Enter the approved authentication password for the restore operation.
-
Enter the number of required restore shares.
-
Select each required share file. The appliance stages selected files locally before running the restore helper. When share files are selected from USB media, the appliance can stage one share, unmount that USB key, then prompt for the next share so separate-custody media can be handled one by one.
-
Let the appliance run the restore helper against the staged
.yhwdirectory. -
Wait for the success message and the Stream restart.
-
Read the imported authentication key IDs displayed on the completion screen.
-
Edit the YubiHSM keystore in Stream and update the PIN. The PIN format is the authentication key ID without the
0xprefix followed by that key password. -
Verify the restored YubiHSM object list with
YUBI > KEYS.
Record the .yhw directory, selected share filenames, imported authentication key IDs, Stream restart result, and post-restore object inventory.
Do not record authentication passwords, key passwords, PIN values, or share values.
If the .yhw directory is selected from the managed USB mountpoint, the appliance copies the .yhw files into a local temporary staging directory and verifies them before invoking the restore helper.
Temporary YubiHSM restore staging is removed when the workflow exits or is cancelled.
If restore fails, keep the appliance running and collect the displayed reason, exit code, and yubi-restore.log path.
Do not retry with different shares until the selected files have been compared against the recovery kit.
Common mistakes
-
Starting Stream before YubiHSM middleware is installed.
-
Treating
YUBI > BACKUPas a Stream backup. -
Forgetting to update the Stream PKCS#11 keystore PIN after YubiHSM restore.
-
Leaving
.yhwfiles or share files on temporary media after distribution. -
Recording secret share values in the operation report.
-
Running
YUBI > RESTOREbefore Stream restore has completed.