pub enum CryptoServiceError<HalError>where
HalError: Debug,{
Atecc(AteccError<HalError>),
InvalidFormat(FormatError),
PinIncorrect {
tries_remaining: u8,
},
PinBlocked,
PukIncorrect {
tries_remaining: u8,
},
Bricked,
PinRequired,
NotProvisioned,
InvalidSlot {
slot: Slot,
},
EmergencyResetNotPermitted {
pin_tries_remaining: u8,
puk_tries_remaining: u8,
},
}Expand description
Error returned by crate::CryptoService methods.
Variants§
Atecc(AteccError<HalError>)
Underlying driver error.
InvalidFormat(FormatError)
PIN or PUK format was rejected (wrong length or non-digit character).
PinIncorrect
PIN verification failed. Tries remaining counter is included.
PinBlocked
PIN slot is hardware-blocked. Only PUK reset can recover.
PukIncorrect
PUK was wrong. After crate::slots::PUK_MAX_RETRIES failures the
chip is bricked.
Bricked
PUK retry count exhausted. The chip is permanently unusable.
PinRequired
A signing operation was requested but the PIN session is not active.
NotProvisioned
The chip has not been provisioned yet (config zone is unlocked, or SHA-256 hashes are not stored in the expected slots).
InvalidSlot
The caller specified a slot index that is invalid for the
requested operation (out of policy, e.g. provision_slot on an
ECC slot, or sign on a slot not configured for ECC).
Fields
slot: SlotThe slot the caller tried to use.
EmergencyResetNotPermitted
The caller asked for crate::CryptoService::emergency_reset but
the precondition (both PIN and PUK batches fully exhausted) is
not met. The user must use the normal recovery paths
(unblock_pin) instead.
Implementations§
Source§impl<HalError> CryptoServiceError<HalError>where
HalError: Debug,
impl<HalError> CryptoServiceError<HalError>where
HalError: Debug,
Sourcepub fn atecc_kind(&self) -> Option<AteccErrorKind>
pub fn atecc_kind(&self) -> Option<AteccErrorKind>
Return the non-generic [AteccErrorKind] if this error wraps a
driver-level failure.
Returns None for variants that originated above the driver layer
(PIN/PUK failures, format errors, session policy violations).
Intended for layers that must serialize the error over a wire
format without naming the concrete HalError type, in particular
the firmware’s USB-HID dispatcher.