[][src]Struct noise_protocol::HandshakeStateBuilder

pub struct HandshakeStateBuilder<'a, D: DH> { /* fields omitted */ }

Builder for HandshakeState.

Methods

impl<'a, D> HandshakeStateBuilder<'a, D> where
    D: DH
[src]

pub fn new() -> Self[src]

Create a new HandshakeStateBuilder.

pub fn set_pattern(&mut self, p: HandshakePattern) -> &mut Self[src]

Set handshake pattern.

pub fn set_is_initiator(&mut self, is: bool) -> &mut Self[src]

Set whether the HandshakeState is initiator.

pub fn set_prologue(&mut self, prologue: &'a [u8]) -> &mut Self[src]

Set prologue.

pub fn set_e(&mut self, e: D::Key) -> &mut Self[src]

Set ephemeral key.

This is not encouraged and usually not necessary. Cf. HandshakeState::new().

pub fn set_s(&mut self, s: D::Key) -> &mut Self[src]

Set static key.

pub fn set_re(&mut self, re: D::Pubkey) -> &mut Self[src]

Set peer semi-ephemeral public key.

Usually used in fallback patterns.

pub fn set_rs(&mut self, rs: D::Pubkey) -> &mut Self[src]

Set peer static public key.

pub fn build_handshake_state<C, H>(self) -> HandshakeState<D, C, H> where
    C: Cipher,
    H: Hash
[src]

Build HandshakeState.

Panics

If any of set_pattern, set_prologue or set_is_initiator has not been called yet.

Trait Implementations

impl<'a, D: DH> Default for HandshakeStateBuilder<'a, D>[src]

Auto Trait Implementations

impl<'a, D> RefUnwindSafe for HandshakeStateBuilder<'a, D> where
    <D as DH>::Key: RefUnwindSafe,
    <D as DH>::Pubkey: RefUnwindSafe

impl<'a, D> Send for HandshakeStateBuilder<'a, D> where
    <D as DH>::Key: Send,
    <D as DH>::Pubkey: Send

impl<'a, D> Sync for HandshakeStateBuilder<'a, D> where
    <D as DH>::Key: Sync,
    <D as DH>::Pubkey: Sync

impl<'a, D> Unpin for HandshakeStateBuilder<'a, D> where
    <D as DH>::Key: Unpin,
    <D as DH>::Pubkey: Unpin

impl<'a, D> UnwindSafe for HandshakeStateBuilder<'a, D> where
    <D as DH>::Key: UnwindSafe,
    <D as DH>::Pubkey: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.