Trait libp2prs_core::pnet::Pnet[][src]

pub trait Pnet<TSocket> {
    type Output: Send;
#[must_use]    fn handshake<'async_trait>(
        self,
        socket: TSocket
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, PnetError>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; }

Associated Types

type Output: Send[src]

Output after the upgrade has been successfully negotiated and the handshake performed.

Loading content...

Required methods

#[must_use]fn handshake<'async_trait>(
    self,
    socket: TSocket
) -> Pin<Box<dyn Future<Output = Result<Self::Output, PnetError>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Loading content...

Implementors

impl<TSocket> Pnet<TSocket> for PnetConfig where
    TSocket: ConnectionInfo + SplittableReadWrite
[src]

type Output = PnetOutput<TSocket>

fn handshake<'async_trait>(
    self,
    socket: TSocket
) -> Pin<Box<dyn Future<Output = Result<Self::Output, PnetError>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

upgrade a connection to use pre shared key encryption.

the upgrade works by both sides exchanging 24 byte nonces and then encrypting subsequent traffic with XSalsa20

Loading content...