Skip to main content

Module keys

Module keys 

Source
Expand description

Key management for license signing and verification

This module provides key management functionality that works with the pluggable cryptographic architecture. It maintains backward compatibility with RSA keys while supporting new algorithms like Ed25519.

§Example

use licenz_core::keys::{CryptoKeyPair, KeyPair, KeySize};
use licenz_core::crypto::algorithm_ids;

// Legacy RSA key pair (backward compatible)
let rsa_keypair = KeyPair::generate(KeySize::Bits2048).unwrap();

// New algorithm-agnostic key pair
let ed25519_keypair = CryptoKeyPair::generate(algorithm_ids::ED25519).unwrap();
let rsa_keypair = CryptoKeyPair::generate(algorithm_ids::RSA_SHA256).unwrap();

Structs§

CryptoKeyPair
Algorithm-agnostic key pair that works with any supported signature algorithm
KeyPair
RSA key pair for license signing

Enums§

KeySize
Supported RSA key sizes

Functions§

extract_public_key
Extract the public key from a private key
parse_private_key
Parse a private key from PEM format
parse_public_key
Parse a public key from PEM format