Recovery
Recovery reconstructs the seed from k storage cards — for example
after the production HSM is lost or destroyed — and re-wraps it for a new HSM.
This page uses a 2-of-3 deployment (any two of the three cards) purely
as a worked example — the procedure is identical for any supported threshold
(k from 2 to 7, n from 2 to 12).
Note
2-of-3 is just an example. Recover with whatever k your deployment
was created with.
Fig. 7 Recovery at a glance — k storage cards are collected, the seed is reconstructed on the orchestrator, then re-wrapped for the new HSM.
Before you begin
Prepare:
1 orchestrator card (any orchestrator in state
0x00; it need not be the one used for the ceremony).``k`` storage cards holding valid shares, with their PINs known.
The RSA public key of the new HSM where the seed will be restored (e.g.
new_hsm_pubkey.pem).Your record of which physical card holds which share index (see Card order (share numbers)).
Note
Card order. On current firmware each storage card reports its own share index, so recovery reconstructs correctly whatever order you insert the cards in — the tool reads the true index from each card. Insertion order only matters on older cards that do not expose their index, where the tool falls back to the order of insertion (first inserted = share #1, …) and a wrong order silently yields the wrong secret. Either way, verify the checksum (below) before trusting the result — it is the definitive check.
Running recovery
shamir-cli workflow full-recovery \
-k 2 \
--rsa-key-file new_hsm_pubkey.pem \
--output-file recovered_seed.bin \
--pin 0000
Options:
Option |
Meaning |
|---|---|
|
Number of shares to collect (must equal the ceremony’s |
|
RSA public key of the new HSM to wrap the recovered seed for. |
|
Where to write the wrapped recovered seed. |
|
Storage card PIN (default |
The tool prompts for the orchestrator and then each storage card:
Insert Orchestrator card and press Enter...
Insert Storage card #1 and press Enter...
Swap back to Orchestrator card and press Enter...
Insert Storage card #2 and press Enter...
Swap back to Orchestrator card and press Enter...
Recovery checksum: 33 F4 A2 59 31 57 9D 19
Wrapped seed saved to recovered_seed.bin
How it works
The orchestrator is reset and enters Recovery mode.
The new HSM RSA wrapping key is loaded; the orchestrator generates an ephemeral encryption key.
For each of the
kcards:You verify the PIN.
The storage card re-encrypts its share to the orchestrator’s key and hands it over. The host only relays opaque ciphertext.
The orchestrator decrypts the share internally.
The orchestrator reconstructs the seed (Lagrange interpolation, performed on-card) and returns a checksum.
The orchestrator exports the RSA-wrapped recovered seed to the output file.
Verifying the result
Always compare the Recovery checksum against the seed checksum you
recorded at the ceremony.
Match → the correct seed was reconstructed. Import
recovered_seed.bininto the new HSM, then destroy the file.Mismatch → you collected the wrong cards, or inserted them in the wrong order. Do not import the result. Re-run, inserting the correctly labelled cards in share-index order.
Operational notes
Export counter. Every real share read during a recovery increments a counter inside the storage card. Inspect it for audit with
shamir-cli storage read-counter. An unexpected increase means a share was read outside a sanctioned recovery.PIN lockout. Three consecutive wrong PINs lock the card. Guard the PINs and the lockout budget.
The PC never sees a plaintext share. Shares move card-to-card over an encrypted channel; the host only relays ciphertext.
Note
Recovery only reads the storage cards — it does not consume or alter the shares. You can recover as many times as needed (each read increments the audit counter).
See also
The Ceremony — how the shares and labels were created.
Backup Test — verify shares without exporting the seed.
Wrong PIN — recovering from PIN errors.
Security Model — what the host can and cannot see.