oxabl-cache-crypto 0.4.0

Client-side cryptography for the oxabl-cache remote compile cache: key hierarchy, seal and open, signatures.
Documentation
//! Client-only cryptography: key hierarchy, lookup ids, seal and open, signatures, roster.
//!
//! Every function that takes bytes from outside treats them as hostile: it checks lengths
//! against the format limits before allocating and returns [`Error`] instead of panicking.
//! Secret types zeroize on drop and never print their contents. The server must never link
//! this crate.
//!
//! The `seal` feature (on by default) adds records, segments, dictionaries and telemetry, which
//! need aws-lc-rs and zstd. Without it, the `portable` feature gives identities, rosters and ID
//! token checks in pure Rust, which build for WebAssembly.

#[cfg(not(any(feature = "seal", feature = "portable")))]
compile_error!("oxabl-cache-crypto needs the `seal` or the `portable` feature");

#[cfg(feature = "seal")]
mod aead;
#[cfg(feature = "seal")]
mod compress;
#[cfg(feature = "seal")]
mod dictionary_seal;
mod domain;
mod keyring;
#[cfg(feature = "seal")]
mod nonce;
mod random;
mod secret;
mod signing;

#[cfg(feature = "seal")]
pub mod dictionary;
pub mod dictionary_pointer;
pub mod error;
pub mod id_token;
pub mod identity;
pub mod identity_env;
pub mod identity_file;
pub mod identity_string;
pub mod join;
pub mod keys;
pub mod lookup;
#[cfg(feature = "seal")]
pub mod object_keys;
#[cfg(feature = "seal")]
pub mod record_context;
#[cfg(feature = "seal")]
pub mod record_entry;
#[cfg(feature = "seal")]
pub mod record_open;
#[cfg(feature = "seal")]
pub mod record_seal;
pub mod roster_draft;
pub mod roster_member;
pub mod roster_verify;
#[cfg(feature = "seal")]
pub mod segment_info;
#[cfg(feature = "seal")]
pub mod segment_open;
#[cfg(feature = "seal")]
pub mod segment_seal;
#[cfg(feature = "seal")]
pub mod telemetry;
#[cfg(feature = "seal")]
pub mod trust;
pub mod vault;

pub use age::secrecy::{ExposeSecret, SecretString};
#[cfg(feature = "seal")]
pub use dictionary::{DEFAULT_DICTIONARY_BYTES, Dictionary, MAX_DICTIONARY_BYTES, train};
pub use dictionary_pointer::{sign_pointer, verify_pointer};
#[cfg(feature = "seal")]
pub use dictionary_seal::{open_dictionary, seal_dictionary};
pub use error::{Error, Result};
pub use identity::Identity;
pub use keys::{LookupKey, RootKey};
#[cfg(feature = "seal")]
pub use keys::{RecordKey, SegmentKey};
#[cfg(feature = "seal")]
pub use object_keys::ObjectKeys;
#[cfg(feature = "seal")]
pub use record_context::RecordContext;
#[cfg(feature = "seal")]
pub use record_entry::{Entry, EntryFields, FileEntry};
#[cfg(feature = "seal")]
pub use record_open::{OpenedRecord, open_record};
#[cfg(feature = "seal")]
pub use record_seal::seal_record;
pub use roster_draft::RosterDraft;
pub use roster_member::MemberEntry;
pub use roster_verify::{RosterPins, VerifiedRoster};
#[cfg(feature = "seal")]
pub use segment_info::{SegmentSeal, sealed_segment_len};
#[cfg(feature = "seal")]
pub use segment_open::{SegmentExpectation, open_segment};
#[cfg(feature = "seal")]
pub use segment_seal::{DEFAULT_ZSTD_LEVEL, SealOptions, seal_compressed, seal_segment};
#[cfg(feature = "seal")]
pub use telemetry::{open_telemetry, seal_telemetry, telemetry_epoch};
#[cfg(feature = "seal")]
pub use trust::{AcceptedRecord, Provenance};