pub enum HardwarePolicy {
Required,
Preferred,
Optional,
}Expand description
How strictly a caller requires hardware binding.
The policy decides what an Absent or
Indeterminate probe means, and it is the
place the fail-closed rule is enforced.
Variants§
Required
Hardware is mandatory. Anything other than a self-tested working hardware component is an error; the keystore does not open.
Preferred
Default. Prefer hardware, and degrade only on a confident negative.
An Indeterminate probe is an error,
not a degrade: silently downgrading “I could not tell” into “there is
none” would let a transient probe failure quietly strip hardware
protection from a wallet that has it, and the resulting software blob
would then be openable anywhere. Failing closed keeps that decision
with the caller.
Optional
Degrade on any negative outcome — including an indeterminate probe —
but always report the distinguishing DegradeReason.
For callers that must open regardless (recovery tooling, read-only inspection). Honest, but permissive.
Implementations§
Source§impl HardwarePolicy
impl HardwarePolicy
Sourcepub const fn allows_degrade(self) -> bool
pub const fn allows_degrade(self) -> bool
Whether this policy tolerates degrading to software at all.
Sourcepub const fn allows_indeterminate_degrade(self) -> bool
pub const fn allows_indeterminate_degrade(self) -> bool
Whether this policy tolerates degrading when the probe could not determine availability.
Trait Implementations§
Source§impl Clone for HardwarePolicy
impl Clone for HardwarePolicy
Source§fn clone(&self) -> HardwarePolicy
fn clone(&self) -> HardwarePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more