pub struct SealClient { /* private fields */ }Expand description
Client for seal/unseal operations in the TEE via RA-TLS.
Connects to the guest’s RA-TLS attestation server, verifies the TEE during the TLS handshake, then sends seal/unseal requests over the encrypted channel. The guest performs the actual crypto using keys derived from its TEE identity (measurement + chip_id).
Implementations§
Source§impl SealClient
impl SealClient
Sourcepub fn new(socket_path: &Path) -> Self
pub fn new(socket_path: &Path) -> Self
Create a new seal client for the given attestation socket.
Sourcepub async fn seal(
&self,
data: &[u8],
context: &str,
policy: &str,
attestation_policy: AttestationPolicy,
allow_simulated: bool,
) -> Result<SealResult>
pub async fn seal( &self, data: &[u8], context: &str, policy: &str, attestation_policy: AttestationPolicy, allow_simulated: bool, ) -> Result<SealResult>
Seal data inside the TEE via RA-TLS.
- Connects to the guest attestation server
- TLS handshake verifies the TEE
- Sends plaintext (base64) over the encrypted channel (Frame protocol)
- Guest encrypts with AES-256-GCM bound to TEE identity
§Arguments
data- Raw data to sealcontext- Application-specific context for key derivationpolicy- Sealing policy name (“MeasurementAndChip”, “MeasurementOnly”, “ChipOnly”)attestation_policy- Attestation policy for TEE verificationallow_simulated- Whether to accept simulated TEE reports
Sourcepub async fn unseal(
&self,
blob: &str,
context: &str,
policy: &str,
attestation_policy: AttestationPolicy,
allow_simulated: bool,
) -> Result<Vec<u8>>
pub async fn unseal( &self, blob: &str, context: &str, policy: &str, attestation_policy: AttestationPolicy, allow_simulated: bool, ) -> Result<Vec<u8>>
Unseal data inside the TEE via RA-TLS.
- Connects to the guest attestation server
- TLS handshake verifies the TEE
- Sends sealed blob over the encrypted channel (Frame protocol)
- Guest decrypts with the TEE-bound key
§Arguments
blob- Base64-encoded sealed blobcontext- Context used during sealingpolicy- Sealing policy used during sealingattestation_policy- Attestation policy for TEE verificationallow_simulated- Whether to accept simulated TEE reports
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SealClient
impl RefUnwindSafe for SealClient
impl Send for SealClient
impl Sync for SealClient
impl Unpin for SealClient
impl UnsafeUnpin for SealClient
impl UnwindSafe for SealClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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