pub struct KeyPair { /* private fields */ }Expand description
X25519 keypair for key exchange
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn from_private_key(key_bytes: [u8; 32]) -> Self
pub fn from_private_key(key_bytes: [u8; 32]) -> Self
Create keypair from existing private key bytes (loaded from file)
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
Get the public key as bytes
Compute shared secret with remote public key Returns error if the result is all-zero (small subgroup attack)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnsafeUnpin for KeyPair
impl UnwindSafe for KeyPair
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