pub trait KeyExchanger {
    // Required methods
    fn name<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn generate_request<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        payload: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn handle_response<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        response: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_complete<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finalize<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<CompletedKeyExchange>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

A trait implemented by both Initiator and Responder peers.

Required Methods§

source

fn name<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return key exchange unique name.

source

fn generate_request<'life0, 'life1, 'async_trait>( &'life0 mut self, payload: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate request that should be sent to the other party.

source

fn handle_response<'life0, 'life1, 'async_trait>( &'life0 mut self, response: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle response from other party and return payload.

source

fn is_complete<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns true if the key exchange process is complete.

source

fn finalize<'async_trait>( self ) -> Pin<Box<dyn Future<Output = Result<CompletedKeyExchange>> + Send + 'async_trait>>where Self: 'async_trait,

Return the data and keys needed for channels. Key exchange must be completed prior to calling this function.

Implementors§