aranya-keygen 5.0.0

Utilities for generating crypto keys
Documentation

Aranya Keygen

Crates.io Docs.rs License

A utility crate for generating cryptographic key bundles for Aranya. This crate provides:

  • Generation of secure cryptographic key bundles
  • Management of identity, encryption, and signing keys
  • Utilities for loading key bundles from storage

Overview

The aranya-keygen crate simplifies the process of generating and managing cryptographic keys for Aranya applications. It provides a unified interface to create key bundles containing:

  • Identity keys (for uniquely identifying devices)
  • Encryption keys (for secure data encryption)
  • Signing keys (for message authentication)

Usage

use anyhow::Result;
use aranya_crypto::{Engine, KeyStore};
use aranya_keygen::PublicKeyBundle;

fn generate_keys<E, S>(engine: &mut E, store: &mut S) -> Result<()>
where
    E: Engine,
    S: KeyStore,
{
    // Generate a new key bundle
    let key_bundle = PublicKeyBundle::generate(engine, store)?;

    // Load the public keys from the bundle
    let public_keys = key_bundle.public_keys(engine, store)?;

    // Use the public keys as needed
    // ...

    Ok(())
}