Skip to main content

ChannelConsumer

Struct ChannelConsumer 

Source
pub struct ChannelConsumer { /* private fields */ }
Expand description

The consumer side of a channel, which seals requests to one attested enclave boot.

Holds no secret: the response key belongs to the ResponseOpener each seal returns.

Implementations§

Source§

impl ChannelConsumer

Source

pub fn from_attestation( domain: ChannelDomain, verifier: &Verifier, attestation_doc: &[u8], enclave_public_key: &[u8], ) -> Result<(ChannelConsumer, VerifiedAttestation), ChannelError>

Initializes a channel from an enclave’s public key and its attestation. Verifies the public key is properly attested by the enclave.

§Errors

Fails if the attestation does not verify, if it does not commit to enclave_public_key, or if that key is not a valid X-Wing encapsulation key.

Source

pub fn from_unverified_public_key( domain: ChannelDomain, enclave_public_key: &[u8], ) -> Result<ChannelConsumer, ChannelError>

Builds a consumer for a provided public key.

§Warning

This method will not verify the public key is attested. Most use cases should use Self::from_attestation.

§Errors

Fails if enclave_public_key is not a valid X-Wing encapsulation key.

Source

pub fn seal_to_enclave( &self, plaintext: &[u8], ) -> Result<(Vec<u8>, ResponseOpener), ChannelError>

Seals one request, returning the ciphertext bytes and the opener for its one response.

§Errors

Fails if the operating system CSPRNG is unavailable, or sealing unexpectedly fails.

Trait Implementations§

Source§

impl Clone for ChannelConsumer

Source§

fn clone(&self) -> ChannelConsumer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChannelConsumer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for ChannelConsumer

§

impl Freeze for ChannelConsumer
where &'static str: Freeze, &'static [u8]: Freeze, PublicKey: Freeze,

§

impl Move for ChannelConsumer

§

impl RefUnwindSafe for ChannelConsumer
where PublicKey: RefUnwindSafe,

§

impl Send for ChannelConsumer
where &'static str: Send, &'static [u8]: Send, PublicKey: Send,

§

impl Sync for ChannelConsumer
where PublicKey: Sync,

§

impl Unpin for ChannelConsumer
where &'static str: Unpin, &'static [u8]: Unpin, PublicKey: Unpin,

§

impl UnsafeUnpin for ChannelConsumer
where &'static str: UnsafeUnpin, &'static [u8]: UnsafeUnpin, PublicKey: UnsafeUnpin,

§

impl UnwindSafe for ChannelConsumer
where &'static str: UnwindSafe, &'static [u8]: UnwindSafe, PublicKey: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V