Skip to main content

KeyGenerator

Trait KeyGenerator 

Source
pub trait KeyGenerator: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn generate_keypair(
        &self,
    ) -> Result<KeyPair<SecretVec, Vec<u8>>, CryptoError>;
}
Expand description

Key pair generator for asymmetric algorithms.

Required Methods§

Source

fn name(&self) -> &'static str

Human-readable algorithm identifier (e.g. "Ed25519").

Source

fn generate_keypair(&self) -> Result<KeyPair<SecretVec, Vec<u8>>, CryptoError>

Generate a fresh key pair.

Returns (secret_key, public_key) wrapped in KeyPair. The secret half uses SecretVec (auto-zeroized on drop).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§