pub struct SecureEnclave { /* private fields */ }Expand description
The Secure Enclave - hardware-protected execution environment
Implementations§
Source§impl SecureEnclave
impl SecureEnclave
Sourcepub fn new(config: EnclaveConfig) -> Self
pub fn new(config: EnclaveConfig) -> Self
Create a new secure enclave
Sourcepub fn initialize(&mut self) -> Result<(), EnclaveError>
pub fn initialize(&mut self) -> Result<(), EnclaveError>
Initialize the enclave
Sourcepub fn enter_secure_mode(&mut self) -> Result<(), EnclaveError>
pub fn enter_secure_mode(&mut self) -> Result<(), EnclaveError>
Enter secure mode (elevate protection)
Sourcepub fn exit_secure_mode(&mut self) -> Result<(), EnclaveError>
pub fn exit_secure_mode(&mut self) -> Result<(), EnclaveError>
Exit secure mode
Sourcepub fn attest(
&mut self,
challenge: &[u8; 32],
) -> Result<AttestationReport, EnclaveError>
pub fn attest( &mut self, challenge: &[u8; 32], ) -> Result<AttestationReport, EnclaveError>
Perform remote attestation
Sourcepub fn verify_attestation(
&self,
report: &AttestationReport,
) -> Result<bool, EnclaveError>
pub fn verify_attestation( &self, report: &AttestationReport, ) -> Result<bool, EnclaveError>
Verify an attestation report
Sourcepub fn seal(
&mut self,
data: &[u8],
policy: SealingPolicy,
) -> Result<SealedData, EnclaveError>
pub fn seal( &mut self, data: &[u8], policy: SealingPolicy, ) -> Result<SealedData, EnclaveError>
Seal data for storage outside enclave
Sourcepub fn unseal(&mut self, sealed: &SealedData) -> Result<Vec<u8>, EnclaveError>
pub fn unseal(&mut self, sealed: &SealedData) -> Result<Vec<u8>, EnclaveError>
Unseal data inside enclave
Sourcepub fn execute_secure<F, T>(&mut self, operation: F) -> Result<T, EnclaveError>where
F: FnOnce() -> T,
pub fn execute_secure<F, T>(&mut self, operation: F) -> Result<T, EnclaveError>where
F: FnOnce() -> T,
Execute sensitive operation inside enclave
Sourcepub fn destroy(&mut self) -> Result<(), EnclaveError>
pub fn destroy(&mut self) -> Result<(), EnclaveError>
Destroy the enclave securely
Sourcepub fn status(&self) -> EnclaveStatus
pub fn status(&self) -> EnclaveStatus
Get enclave status
Sourcepub fn stats(&self) -> &EnclaveStats
pub fn stats(&self) -> &EnclaveStats
Get enclave statistics
Sourcepub fn enclave_id(&self) -> u64
pub fn enclave_id(&self) -> u64
Get enclave ID
Sourcepub fn platform(&self) -> TeePlatform
pub fn platform(&self) -> TeePlatform
Get platform
Trait Implementations§
Source§impl Debug for SecureEnclave
impl Debug for SecureEnclave
Auto Trait Implementations§
impl Freeze for SecureEnclave
impl RefUnwindSafe for SecureEnclave
impl Send for SecureEnclave
impl Sync for SecureEnclave
impl Unpin for SecureEnclave
impl UnwindSafe for SecureEnclave
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
Mutably borrows from an owned value. Read more