pub struct Keypair { /* private fields */ }Expand description
Principal keypair (X25519)
Implementations§
Source§impl Keypair
impl Keypair
Sourcepub fn from_secret_bytes(bytes: &[u8; 32]) -> Self
pub fn from_secret_bytes(bytes: &[u8; 32]) -> Self
Construct keypair from secret key bytes (e.g., from config file)
Sourcepub fn secret_key_bytes(&self) -> [u8; 32]
pub fn secret_key_bytes(&self) -> [u8; 32]
Get the secret key as bytes (for storage)
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Get the public key
Sourcepub fn public_key_bytes(&self) -> [u8; 32]
pub fn public_key_bytes(&self) -> [u8; 32]
Get the public key as bytes (for storage)
Derive shared secret with another principal’s public key (ECDH)
Trait Implementations§
impl ZeroizeOnDrop for Keypair
Auto Trait Implementations§
impl Freeze for Keypair
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin 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