pub struct IdentityKeypair { /* private fields */ }Expand description
Ed25519 signing keypair. Private key is zeroed on drop (handled by
ed25519-dalek’s internal Zeroize).
Implementations§
Source§impl Keypair
impl Keypair
Sourcepub fn from_derived_key(key: &DerivedKey) -> Keypair
pub fn from_derived_key(key: &DerivedKey) -> Keypair
Create a keypair from derived key material (Argon2id output).
Sourcepub fn from_random() -> Keypair
pub fn from_random() -> Keypair
Generate a random keypair (for ephemeral session or one-time keys).
Sourcepub fn from_signing_key(key: SigningKey) -> Keypair
pub fn from_signing_key(key: SigningKey) -> Keypair
Wrap an existing SigningKey (for callers that hold one already).
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get the public key for this keypair.
Sourcepub fn sign(&self, message: &[u8]) -> Vec<u8> ⓘ
pub fn sign(&self, message: &[u8]) -> Vec<u8> ⓘ
Sign a message and return the 64-byte signature.
Sourcepub fn to_seed_bytes(&self) -> [u8; 32]
pub fn to_seed_bytes(&self) -> [u8; 32]
Extract the 32-byte seed for at-rest persistence. The caller is responsible for protecting the bytes (file permissions, encryption).
Sourcepub fn to_x25519_secret_bytes(&self) -> [u8; 32]
pub fn to_x25519_secret_bytes(&self) -> [u8; 32]
Convert this Ed25519 signing key into an X25519 secret scalar (32 bytes, bit-clamped). Used by the pairwise wrap path so the same identity that signs Auth events also drives Crypt ECDH; no separate keypair is stored. The conversion follows the standard Ed25519-to-X25519 procedure: SHA-512 of the seed, take the first 32 bytes, apply X25519 bit clamping.