pub struct EcdhKeypair { /* private fields */ }Expand description
A freshly generated X25519 keypair for the ECDH handshake.
The secret is zeroized on drop. Keep the secret on the side that generated
it and send only the EcdhKeypair::public bytes to the peer.
Implementations§
Source§impl EcdhKeypair
impl EcdhKeypair
Sourcepub fn generate() -> Result<Self, ProtocolError>
pub fn generate() -> Result<Self, ProtocolError>
Generates a random X25519 keypair using the platform CSPRNG.
Sourcepub fn public_bytes(&self) -> [u8; 32]
pub fn public_bytes(&self) -> [u8; 32]
Returns the 32-byte public key that should be sent to the peer.
Auto Trait Implementations§
impl Freeze for EcdhKeypair
impl RefUnwindSafe for EcdhKeypair
impl Send for EcdhKeypair
impl Sync for EcdhKeypair
impl Unpin for EcdhKeypair
impl UnsafeUnpin for EcdhKeypair
impl UnwindSafe for EcdhKeypair
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more