Builder

Struct Builder 

Source
pub struct Builder<K, PG, NG, T, N, P, S, SS>
where K: KeyType + KeyGenerator<T, P, S> + KeyAgreement<T, P, S, SS>, PG: Prologue, NG: NonceGenerator<T, N>, T: Tag, N: TaggedData<T>, P: TaggedData<T>, S: TaggedData<T>, SS: TaggedData<T>,
{ /* private fields */ }
Expand description

Generates a HandshakeState and also validates that all of the prerequisites for the given parameters are satisfied.

Implementations§

Source§

impl<K, PG, NG, T, N, P, S, SS> Builder<K, PG, NG, T, N, P, S, SS>
where K: KeyType + KeyGenerator<T, P, S> + KeyAgreement<T, P, S, SS>, PG: Prologue, NG: NonceGenerator<T, N>, T: Tag, N: TaggedData<T>, P: TaggedData<T>, S: TaggedData<T>, SS: TaggedData<T>,

Source

pub fn new(params: &Params<K, T, P, S, SS>, nonce_generator: &NG) -> Self

Construct a new builder from DiscoParams

Source

pub fn with_prologue(self, data: &PG) -> Self

Add prologue byte sequence that both parties want to confirm is identical

Source

pub fn local_static_secret_key(self, key: &S) -> Self

Add a local static secret key

Source

pub fn local_static_public_key(self, key: &P) -> Self

Add a local static public key

Source

pub fn local_ephemeral_secret_key(self, key: &S) -> Self

Add a local ephemeral secret key

Source

pub fn local_ephemeral_public_key(self, key: &P) -> Self

Add a local ephemeral public key

Source

pub fn remote_static_public_key(self, key: &P) -> Self

Add a remote static public key

Source

pub fn pre_shared_key(self, key: &SS) -> Self

Add a pre-shared key

Source

pub fn msg_order(self, order: &TransportOrder) -> Self

Create strobe states that can handle out-of-order messages

Source

pub fn build_initiator( self, ) -> Result<Session<K, PG, NG, T, N, P, S, SS>, Error>

Build an initiator disco session

Source

pub fn build_responder( self, ) -> Result<Session<K, PG, NG, T, N, P, S, SS>, Error>

Build a responder disco session

Source

pub fn build( self, role: &ChannelRole, ) -> Result<Session<K, PG, NG, T, N, P, S, SS>, Error>

Construct the disco session

Auto Trait Implementations§

§

impl<K, PG, NG, T, N, P, S, SS> Freeze for Builder<K, PG, NG, T, N, P, S, SS>
where PG: Freeze, NG: Freeze, S: Freeze, P: Freeze, SS: Freeze, K: Freeze,

§

impl<K, PG, NG, T, N, P, S, SS> RefUnwindSafe for Builder<K, PG, NG, T, N, P, S, SS>

§

impl<K, PG, NG, T, N, P, S, SS> Send for Builder<K, PG, NG, T, N, P, S, SS>
where PG: Send, NG: Send, S: Send, P: Send, SS: Send, K: Send, T: Send, N: Send,

§

impl<K, PG, NG, T, N, P, S, SS> Sync for Builder<K, PG, NG, T, N, P, S, SS>
where PG: Sync, NG: Sync, S: Sync, P: Sync, SS: Sync, K: Sync, T: Sync, N: Sync,

§

impl<K, PG, NG, T, N, P, S, SS> Unpin for Builder<K, PG, NG, T, N, P, S, SS>
where PG: Unpin, NG: Unpin, S: Unpin, P: Unpin, SS: Unpin, K: Unpin, T: Unpin, N: Unpin,

§

impl<K, PG, NG, T, N, P, S, SS> UnwindSafe for Builder<K, PG, NG, T, N, P, S, SS>

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<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, 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