#[non_exhaustive]pub enum HardwareKind {
WindowsTpm20,
MacSecureEnclave,
LinuxTpm20,
}Expand description
A class of OS hardware trusted component that can hold a non-exportable wrapping key.
The discriminant is a stable wire id: it is written into the
envelope header, so a blob records which hardware
class sealed it. Values are append-only — never renumber or repurpose
one (§5.1: a sealed blob is permanent at-rest data).
#[non_exhaustive]: append-only means this WILL grow, so a downstream match
must carry a wildcard arm rather than break each time hardware is added.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WindowsTpm20
Windows TPM 2.0, reached through the CNG Platform Crypto Provider.
MacSecureEnclave
Apple Secure Enclave (kSecAttrTokenIDSecureEnclave).
LinuxTpm20
Linux TPM 2.0 via the tpm2 software stack.
Implementations§
Source§impl HardwareKind
impl HardwareKind
Sourcepub const fn wire_id(self) -> u8
pub const fn wire_id(self) -> u8
Stable on-wire discriminant written into a sealed envelope header.
Sourcepub const fn from_wire_id(id: u8) -> Option<Self>
pub const fn from_wire_id(id: u8) -> Option<Self>
Parse a wire discriminant, or None for an id this build does not know.
An unknown id is a forward-compatibility case, not corruption: a newer writer may have sealed with hardware this build has no name for. The caller reports it as unopenable-here rather than as a bad file.
Trait Implementations§
Source§impl Clone for HardwareKind
impl Clone for HardwareKind
Source§fn clone(&self) -> HardwareKind
fn clone(&self) -> HardwareKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more