uselesskey-core 0.6.0

Core factory, deterministic derivation, and cache engine for uselesskey test fixtures.
Documentation
#![forbid(unsafe_code)]
#![cfg_attr(not(feature = "std"), no_std)]

//! Core building blocks for `uselesskey`.
//!
//! Most users should depend on the `uselesskey` facade crate instead.
//!
//! This crate provides:
//! - deterministic, order-independent artifact derivation
//! - a concurrency-friendly cache
//! - tempfile sinks
//! - generic "negative fixture" helpers (corrupt PEM, truncate DER)
//!
//! # Architecture
//!
//! The core concept is the [`Factory`], which manages artifact generation and caching.
//! It operates in two modes:
//!
//! - **Random mode**: Artifacts are generated with OS randomness, cached per-factory.
//! - **Deterministic mode**: Artifacts are derived from a master seed using BLAKE3,
//!   ensuring the same `(domain, label, spec, variant)` always produces the same artifact.
//!
//! # Extension Pattern
//!
//! Key types (RSA, ECDSA, etc.) are added via extension traits that add methods to `Factory`.
//! See `uselesskey-rsa` for an example implementation.
//!
//! ```
//! use uselesskey_core::Factory;
//!
//! let fx = Factory::random();
//! // Extension crates add methods like: fx.rsa("label", spec)
//! ```

mod error;
mod factory;
mod id;
pub mod negative;
#[cfg(feature = "std")]
pub mod sink;

pub use crate::error::Error;
pub use crate::factory::{Factory, Mode};
pub use crate::id::{ArtifactDomain, ArtifactId, DerivationVersion, Seed};

extern crate alloc;