pub(crate) enum Command {
Show 23 variants
Enumerate,
Info,
ReadConfig,
ReadConfigSlot {
slot: u8,
},
ReadSlotBlock {
slot: u8,
block: u8,
},
ReadSlotWord {
slot: u8,
block: u8,
offset: u8,
},
WriteConfig {
path: String,
},
ProvisionSlot {
slot: u8,
value: String,
},
ProvisionToken {
secrets_file: String,
},
GetPubkey {
slot: u8,
},
Genkey {
slot: u8,
},
Sign {
slot: u8,
challenge: String,
},
VerifyPin {
pin: String,
},
SetPin {
old: String,
new: String,
io_key: String,
},
UnblockPin {
puk: String,
new_pin: String,
io_key: String,
},
SetPuk {
old: String,
new: String,
io_key: String,
},
CloseSession,
EmergencyResetDangerous {
io_key: String,
},
PinStatus,
ReadCounter {
id: u8,
},
LockConfigDangerous,
LockDataDangerous,
LockSlotDangerous {
slot: u8,
},
}Variants§
Enumerate
Enumerate all USB HID devices and print those matching the mini-HSM vendor / product IDs.
Info
Send an Info request and pretty-print the response.
ReadConfig
Read the chip’s 128-byte config zone and dump it as hex.
ReadConfigSlot
Read the per-slot configuration (SlotConfig + KeyConfig). Returns 4 bytes : [SlotConfig lo/hi, KeyConfig lo/hi].
ReadSlotBlock
Read one 32-byte block of a data slot. The chip enforces the
slot’s read policy (private ECC slots refuse reads). Mostly
useful for bring-up diagnostics and to verify what
ProvisionSlot wrote before locking the data zone.
ReadSlotWord
Read one 4-byte word of a data slot.
Fields
WriteConfig
Write the writable bytes of the config zone (provisioning). Reversible while the zone is unlocked.
ProvisionSlot
Write a 32-byte value in cleartext into one of the data slots 5, 6, or 8. Only legal before the data zone is locked. Used for the initial provisioning of the PIN hash, PUK hash, and IO key.
ProvisionToken
Orchestrate the full data-zone provisioning of a fresh,
config-locked token in one shot: generate IO key (slot 8),
initial PIN hash (slot 5, PIN = “0000”), initial PUK (slot 6,
random 8 digits), and the primary identity key (slot 0). The
IO key and PUK are written to secrets_file (JSON) and also
printed on stdout. Both are required for later operations and
cannot be retrieved later.
Fields
GetPubkey
Read the public key of a slot.
Genkey
Regenerate the private key in a slot (P-256, on-chip).
Sign
Sign a 32-byte challenge after PIN + touch.
VerifyPin
Open a PIN session.
SetPin
Change the PIN. Requires an active PIN session.
UnblockPin
Reset the PIN using the PUK.
Fields
SetPuk
Change the PUK. Requires an active PIN session (call verify-pin
first) AND the current PUK. The current PUK is re-verified
against slot 6, which consumes one Counter1 attempt internally
(refreshed on success).
CloseSession
Close the active PIN session immediately. Idempotent: succeeds even if no session is open. Use this to lock the dongle proactively after a signing burst instead of waiting for the 30 s inactivity timeout.
EmergencyResetDangerous
LAST-CHANCE RECOVERY. Only usable when both the PIN and the PUK batches are exhausted (i.e. the user has forgotten both and tried until they hit zero attempts on both). Destroys every user secret in the chip and rebuilds a clean baseline with PIN “0000” and a fresh random PUK. ECC private keys in slots 0..=4 and 7 are lost. The chip survives.
PinStatus
Read current PIN / PUK retry counters and session state.
ReadCounter
Read the raw value of one of the chip’s monotonic counters.
Diagnostic command. Returns the binary count the chip’s Counter
command sees, without the batch-arithmetic conversion that
pin-status applies. Use during bring-up to verify what the
chip actually stores.
LockConfigDangerous
Lock the config zone. Irreversible. Reads the chip’s configuration zone, computes the CRC-16 over the full 128 bytes, and shows it in the double-confirmation prompt. The same CRC is passed to the chip, which verifies one last time before committing.
LockDataDangerous
Lock the data zone. Irreversible. No CRC is checked at lock
time: every secret-bearing slot has IsSecret=1 and cannot be
read back. The double-confirmation prompt is the only safety
beyond the magic-word check.
LockSlotDangerous
Lock an individual slot. Irreversible. Requires the slot index and an interactive confirmation.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand