Expand description
Pluggable cryptographic architecture using the strategy pattern.
This module provides a flexible crypto system that allows switching between different signature algorithms (RSA-SHA256, Ed25519, and post-quantum algorithms).
§Classical Algorithms
- RSA-SHA256: Traditional RSA signatures with SHA-256 hashing
- Ed25519: Fast, modern elliptic curve signatures
§Post-Quantum Algorithms (feature: post-quantum)
- ML-DSA-65: NIST FIPS 204 lattice-based signatures
- ML-KEM-768: NIST FIPS 203 key encapsulation mechanism
§Hybrid Algorithms (feature: post-quantum)
- Hybrid-RSA-ML-DSA-65: RSA + ML-DSA-65 dual signatures
- Hybrid-Ed25519-ML-DSA-65: Ed25519 + ML-DSA-65 dual signatures
Hybrid modes require BOTH signatures to verify, providing security even if one algorithm is compromised (defense in depth).
§Example
use licenz_core::crypto::{SignatureAlgorithm, CryptoRegistry};
// Get an algorithm by ID
let algorithm = CryptoRegistry::get_signature_algorithm("RSA-SHA256").unwrap();
println!("Using algorithm: {}", algorithm.algorithm_id());
// List all supported algorithms
for alg_id in CryptoRegistry::supported_signature_algorithms() {
println!("Supported: {}", alg_id);
}Re-exports§
pub use crate::keys::CryptoKeyPair;
Modules§
- algorithm_
ids - Algorithm identifiers for signature algorithms
- ed25519
- Ed25519 signature algorithm implementation.
- rsa
- RSA-SHA256 signature algorithm implementation.
Structs§
- Crypto
Registry - Registry for cryptographic algorithms
Traits§
- Encryption
Algorithm - Trait for symmetric encryption algorithms
- Signature
Algorithm - Trait for signature algorithms (strategy pattern)
Type Aliases§
- Boxed
Encryption Algorithm - A boxed encryption algorithm for dynamic dispatch
- Boxed
Signature Algorithm - A boxed signature algorithm for dynamic dispatch