Trait ockam_key_exchange_core::KeyExchanger[][src]

pub trait KeyExchanger {
    fn generate_request(&mut self, payload: &[u8]) -> Result<Vec<u8>>;
fn handle_response(&mut self, response: &[u8]) -> Result<Vec<u8>>;
fn is_complete(&self) -> bool;
fn finalize(self) -> Result<CompletedKeyExchange>; }
Expand description

A trait implemented by both Initiator and Responder peers.

Required methods

fn generate_request(&mut self, payload: &[u8]) -> Result<Vec<u8>>[src]

Generate request that should be sent to the other party.

fn handle_response(&mut self, response: &[u8]) -> Result<Vec<u8>>[src]

Handle response from other party and return payload.

fn is_complete(&self) -> bool[src]

Returns true if the key exchange process is complete.

fn finalize(self) -> Result<CompletedKeyExchange>[src]

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

Implementors