pub struct StaticSecret { /* private fields */ }Expand description
X25519 static secret key for key exchange
This key should be generated once and stored securely. For Perfect Forward Secrecy, use ephemeral keys for each session.
Implementations§
Source§impl StaticSecret
impl StaticSecret
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Create from raw bytes
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get the corresponding public key
Sourcepub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret
pub fn diffie_hellman(&self, their_public: &PublicKey) -> SharedSecret
Perform Diffie-Hellman key exchange
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StaticSecret
impl RefUnwindSafe for StaticSecret
impl Send for StaticSecret
impl Sync for StaticSecret
impl Unpin for StaticSecret
impl UnwindSafe for StaticSecret
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