pub trait KeyExchange<Rhs: ?Sized = Self> {
// Required method
fn write_key_exchange(
&self,
other: &Rhs,
out: &mut dyn WriteBuffer,
) -> Result<(), Error>;
// Provided method
fn key_exchange_bytes(&self, other: &Rhs) -> Result<SecretBytes, Error> { ... }
}Expand description
Trait for keys supporting Diffie-Helman key exchange
Required Methods§
Sourcefn write_key_exchange(
&self,
other: &Rhs,
out: &mut dyn WriteBuffer,
) -> Result<(), Error>
fn write_key_exchange( &self, other: &Rhs, out: &mut dyn WriteBuffer, ) -> Result<(), Error>
Perform a key exchange, writing the result to the provided buffer.
Provided Methods§
Sourcefn key_exchange_bytes(&self, other: &Rhs) -> Result<SecretBytes, Error>
Available on crate feature alloc only.
fn key_exchange_bytes(&self, other: &Rhs) -> Result<SecretBytes, Error>
alloc only.Perform a key exchange and return a new allocated buffer.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl KeyExchange for AnyKey
Available on crate feature
any_key only.impl KeyExchange for K256KeyPair
Available on crate feature
k256 only.impl KeyExchange for P256KeyPair
Available on crate features
p256_hardware or p256 only.impl KeyExchange for P384KeyPair
Available on crate feature
p384 only.impl KeyExchange for X25519KeyPair
Available on crate feature
ed25519 only.