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
impl ChannelConsumer
Sourcepub fn from_attestation(
domain: ChannelDomain,
verifier: &Verifier,
attestation_doc: &[u8],
enclave_public_key: &[u8],
) -> Result<(ChannelConsumer, VerifiedAttestation), ChannelError>
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.
Sourcepub fn from_unverified_public_key(
domain: ChannelDomain,
enclave_public_key: &[u8],
) -> Result<ChannelConsumer, ChannelError>
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.
Sourcepub fn seal_to_enclave(
&self,
plaintext: &[u8],
) -> Result<(Vec<u8>, ResponseOpener), ChannelError>
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
impl Clone for ChannelConsumer
Source§fn clone(&self) -> ChannelConsumer
fn clone(&self) -> ChannelConsumer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for ChannelConsumer
impl Freeze for ChannelConsumer
impl Move for ChannelConsumer
impl RefUnwindSafe for ChannelConsumerwhere
PublicKey: RefUnwindSafe,
impl Send for ChannelConsumer
impl Sync for ChannelConsumerwhere
PublicKey: Sync,
impl Unpin for ChannelConsumer
impl UnsafeUnpin for ChannelConsumer
impl UnwindSafe for ChannelConsumer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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