#[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 moreimpl Copy for HardwareKind
Source§impl Debug for HardwareKind
impl Debug for HardwareKind
Source§impl Display for HardwareKind
impl Display for HardwareKind
impl Eq for HardwareKind
Source§impl Hash for HardwareKind
impl Hash for HardwareKind
Source§impl PartialEq for HardwareKind
impl PartialEq for HardwareKind
impl StructuralPartialEq for HardwareKind
Auto Trait Implementations§
impl Freeze for HardwareKind
impl RefUnwindSafe for HardwareKind
impl Send for HardwareKind
impl Sync for HardwareKind
impl Unpin for HardwareKind
impl UnsafeUnpin for HardwareKind
impl UnwindSafe for HardwareKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more