pub struct StaticKeypair { /* private fields */ }Available on crate feature
crypto only.Expand description
A static X25519 keypair for long-term identity.
The private key is zeroized on drop for security.
Implementations§
Source§impl StaticKeypair
impl StaticKeypair
Sourcepub fn from_bytes(private: [u8; 32], public: [u8; 32]) -> Self
pub fn from_bytes(private: [u8; 32], public: [u8; 32]) -> Self
Create a keypair from existing key material.
§Safety
The caller must ensure the private key is valid X25519 key material.
Sourcepub fn public_key(&self) -> &[u8; 32]
pub fn public_key(&self) -> &[u8; 32]
Get the public key.
Sourcepub fn private_key(&self) -> &[u8; 32]
pub fn private_key(&self) -> &[u8; 32]
Trait Implementations§
Source§impl Clone for StaticKeypair
impl Clone for StaticKeypair
Source§fn clone(&self) -> StaticKeypair
fn clone(&self) -> StaticKeypair
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StaticKeypair
impl RefUnwindSafe for StaticKeypair
impl Send for StaticKeypair
impl Sync for StaticKeypair
impl Unpin for StaticKeypair
impl UnwindSafe for StaticKeypair
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