pub trait KeyExchange: Send {
// Required methods
fn generate(&mut self) -> Vec<u8> ⓘ;
fn compute_shared_secret(&self, peer_public: &[u8]) -> Option<Vec<u8>>;
fn group_id(&self) -> u16;
}Expand description
Key exchange group trait.
Required Methods§
Sourcefn generate(&mut self) -> Vec<u8> ⓘ
fn generate(&mut self) -> Vec<u8> ⓘ
Generate an ephemeral keypair. Returns the public key bytes to send in KeyShare/ClientKeyExchange.
Compute the shared secret from the peer’s public key. Returns None if the peer’s key is invalid.