pub struct X25519KeyPair { /* private fields */ }Expand description
X25519 key pair for key exchange
Implementations§
Source§impl X25519KeyPair
impl X25519KeyPair
Sourcepub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, KeyExchangeError>
pub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, KeyExchangeError>
Create from existing secret key bytes
Sourcepub fn public_key(&self) -> &X25519PublicKey
pub fn public_key(&self) -> &X25519PublicKey
Get public key
Sourcepub fn exchange(&self, peer_public: &X25519PublicKey) -> SharedSecret
pub fn exchange(&self, peer_public: &X25519PublicKey) -> SharedSecret
Perform key exchange with a peer’s public key
Auto Trait Implementations§
impl Freeze for X25519KeyPair
impl RefUnwindSafe for X25519KeyPair
impl Send for X25519KeyPair
impl Sync for X25519KeyPair
impl Unpin for X25519KeyPair
impl UnwindSafe for X25519KeyPair
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