Skip to main content

KeySettlement

Struct KeySettlement 

Source
pub struct KeySettlement<C> { /* private fields */ }
Expand description

Client-side key settlement handling

Implementations§

Source§

impl<C: KeySettlementCore> KeySettlement<C>

Source

pub fn new(core: C) -> Self

Source

pub async fn settle(&mut self, data: &C::Data) -> Result<()>

Settle a new key with the service

§Errors

Returns errors if the request fails, the attestation verification fails or the response does not meet the expectations.

§Panics

Panics if Base64 values are not valid HTTP header values.

Source

pub fn system_version(&self) -> Option<&PublishedVersionEntry>

System version for the currently established session

Source

pub async fn seal( &mut self, data: &[u8], user_data: &C::Data, ) -> Result<Vec<u8>>

Seal data for the service

Settles a key if none is settled.

§Errors

Forwards errors from settle

§Panics

Panics if chacha_box_ietf::seal panics.

Source

pub fn try_seal(&self, data: &[u8]) -> Option<Vec<u8>>

Seal data for the service

Returns None if no key is settled.

§Panics

Panics if chacha_box_ietf::seal panics.

Source

pub fn unseal(&self, data: &[u8]) -> Result<Vec<u8>, Error>

Unseal data from the service

§Errors

Forwards errors from chacha_box_ietf::unseal.

Source

pub async fn session_id(&mut self, user_data: &C::Data) -> Result<&HeaderValue>

Return a settled session ID

Settles a key if none is settled.

§Errors

Forwards errors from settle

Source

pub fn try_session_id(&self) -> Option<&HeaderValue>

Return a settled session ID

Returns None if no key is settled.

Trait Implementations§

Source§

impl<C: Debug> Debug for KeySettlement<C>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C> !Freeze for KeySettlement<C>

§

impl<C> RefUnwindSafe for KeySettlement<C>
where C: RefUnwindSafe,

§

impl<C> Send for KeySettlement<C>
where C: Send,

§

impl<C> Sync for KeySettlement<C>
where C: Sync,

§

impl<C> Unpin for KeySettlement<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for KeySettlement<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for KeySettlement<C>
where C: 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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