#[non_exhaustive]pub struct TeeCapabilities {
pub sgx: Detection,
pub tdx: Detection,
pub sev: Detection,
pub sev_snp: Detection,
pub trustzone: Detection,
pub secure_enclave: Detection,
pub nitro: Detection,
}Expand description
Snapshot of every TEE probe the vault knows how to run on this host.
Adding a new probe is a minor-version change — the struct is
#[non_exhaustive]. Existing fields will not change meaning across the 1.x
line.
§Examples
use key_vault::tee::{detect_tee_capabilities, Detection};
let caps = detect_tee_capabilities();
// We cannot assert specific values — the result depends on hardware. But
// every field is queryable:
let _ = caps.sgx;
let _ = caps.tdx;
let _ = caps.sev;
let _ = caps.sev_snp;
let _ = caps.trustzone;
let _ = caps.secure_enclave;
let _ = caps.nitro;
// Display is implemented for human-readable summaries:
let _ = format!("{caps}");Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sgx: DetectionIntel Software Guard Extensions (SGX). Detected by CPUID leaf 7,
EBX bit 2 on x86_64. Always Unknown on non-x86_64.
tdx: DetectionIntel Trust Domain Extensions (TDX). Detected by CPUID leaf 0x21
returning the “IntelTDX “ signature in EBX/ECX/EDX on x86_64.
Always Unknown on non-x86_64.
sev: DetectionAMD Secure Encrypted Virtualization (SEV). Detected by CPUID extended
leaf 0x8000001F EAX bit 1 on x86_64. Always Unknown on non-x86_64
or on Intel hosts.
sev_snp: DetectionAMD Secure Encrypted Virtualization — Secure Nested Paging (SEV-SNP).
Detected by CPUID extended leaf 0x8000001F EAX bit 4 on x86_64.
Always Unknown on non-x86_64 or on Intel hosts.
trustzone: DetectionARM TrustZone. Userspace cannot reliably probe TrustZone availability
without privileged registers, so this is always Unknown in 1.0.
Operators that know their hardware supports TrustZone should configure
the vault explicitly.
secure_enclave: DetectionApple Secure Enclave. Reported as Detected on Apple Silicon
(aarch64-apple-darwin), NotDetected on Intel macOS, and Unknown
on non-Apple platforms.
nitro: DetectionAWS Nitro Enclaves availability. On Linux this is inferred from the
DMI system vendor (/sys/devices/virtual/dmi/id/sys_vendor); other
hosts report Unknown.
Implementations§
Source§impl TeeCapabilities
impl TeeCapabilities
Sourcepub fn any_detected(self) -> bool
pub fn any_detected(self) -> bool
Returns true if at least one probe positively confirmed a TEE.
This is the convenience predicate for “should I prefer a hardware-backed
fetcher?”. Unknown does not count.
Trait Implementations§
Source§impl Clone for TeeCapabilities
impl Clone for TeeCapabilities
Source§fn clone(&self) -> TeeCapabilities
fn clone(&self) -> TeeCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TeeCapabilities
impl Debug for TeeCapabilities
Source§impl Display for TeeCapabilities
impl Display for TeeCapabilities
Source§impl Hash for TeeCapabilities
impl Hash for TeeCapabilities
Source§impl PartialEq for TeeCapabilities
impl PartialEq for TeeCapabilities
Source§fn eq(&self, other: &TeeCapabilities) -> bool
fn eq(&self, other: &TeeCapabilities) -> bool
self and other values to be equal, and is used by ==.