auths-keri 0.1.3

KERI protocol types, SAID computation, and validation
Documentation
// crate-level allow during curve-agnostic refactor. Removed or narrowed in fn-114.40 after Phase 4 sweeps.
#![allow(clippy::disallowed_methods)]
#![deny(
    clippy::print_stdout,
    clippy::print_stderr,
    clippy::exit,
    clippy::dbg_macro
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(clippy::too_many_lines, clippy::cognitive_complexity)]
#![warn(missing_docs)]

//! KERI protocol types, SAID computation, and CESR translation for Auths.
//!
//! The default feature set provides pure KERI types and SAID utilities with
//! no heavy dependencies — suitable for WASM and FFI embedding.
//!
//! Enable the `cesr` feature for bidirectional conversion between Auths'
//! internal JSON event representation and spec-compliant CESR streams
//! (Trust over IP KERI v0.9).
//!
//! Usage (default, no CESR):
//! ```ignore
//! use auths_keri::{Prefix, Said, compute_said};
//!
//! let said = compute_said(&event_json)?;
//! ```
//!
//! Usage (with CESR feature):
//! ```ignore
//! use auths_keri::{CesrV1Codec, export_kel_as_cesr};
//!
//! let codec = CesrV1Codec::new();
//! let cesr_stream = export_kel_as_cesr(&codec, &events)?;
//! ```

/// ACDC (Authentic Chained Data Container) credential type, SAID-ification, and
/// the pinned v1 capability schema.
pub mod acdc;
/// Validated capability identifiers — the atomic unit of authorization in Auths.
pub mod capability;
mod crypto;
mod error;
mod events;
pub mod kel_io;
mod keys;
/// Key-State Notice (KSN) — signed snapshot of current key-state for thin clients.
pub mod ksn;
/// Routed KERI message types (qry, rpy, pro, bar, xip, exn).
pub mod messages;
mod said;
mod state;
/// Backerless TEL (Transaction Event Log) credential-status events: `vcp`/`iss`/`rev`.
pub mod tel;
mod types;
mod validate;
/// Witness protocol types: receipts, providers, and error reporting for split-view defense.
pub mod witness;

/// CESR-correct primitive encoding (verkeys, digests, SAIDs) via `cesride` — the
/// byte-interoperable wire format that replaces the legacy naive base64 scheme.
mod cesr_encode;

#[cfg(feature = "cesr")]
mod codec;
#[cfg(feature = "cesr")]
mod event;
#[cfg(feature = "cesr")]
mod roundtrip;
#[cfg(feature = "cesr")]
mod stream;
#[cfg(feature = "cesr")]
mod version;

pub use acdc::{
    ACDC_KERIPY_REVISION, ACDC_VERSION_PREFIX, Acdc, AcdcError, Attributes, CAPABILITY_SCHEMA,
    compute_capability_schema_said, compute_schema_said,
};
pub use capability::{
    Capability, CapabilityError, MANAGE_MEMBERS, ROTATE_KEYS, SIGN_COMMIT, SIGN_RELEASE,
};
pub use crypto::{compute_next_commitment, verify_commitment};
pub use error::{KeriTranslationError, TelError};
pub use events::{
    AgentScope, DipEvent, DipEventInit, DrtEvent, DrtEventInit, Event, IcpEvent, IcpEventInit,
    IndexedSignature, IxnEvent, KERI_VERSION_PREFIX, KeriSequence, RotEvent, RotEventInit, Seal,
    SignedEvent, SourceSeal, decode_agent_scope, encode_agent_scope, parse_attachment,
    parse_delegated_attachment, parse_source_seal_couples, serialize_attachment,
    serialize_source_seal_couples,
};
pub use keys::{KeriDecodeError, KeriPublicKey};
pub use ksn::{KSN_TYPE, KSN_VERSION, KeyStateNotice, KsnError, SignedKsn};
pub use said::{
    Protocol, SAID_PLACEHOLDER, compute_said, compute_said_with_protocol, compute_section_said,
    verify_said,
};
pub use state::{AnchorStatus, KeyState};
pub use tel::{
    Iss, Rev, TEL_KERIPY_REVISION, TRAIT_NO_BACKERS, TelAnchorSeal, TelEvent, TelState, Vcp,
    encode_nonce as encode_tel_nonce, to_wire_bytes as tel_to_wire_bytes, validate_tel,
};
pub use types::{
    CesrKey, ConfigTrait, Fraction, FractionError, KeriTypeError, Prefix, Said, Threshold,
    VersionString,
};
pub use validate::{
    DelegatorKelLookup, KelPolicy, ValidationError, WitnessedReplay, compute_event_said,
    finalize_dip_event, finalize_drt_event, finalize_icp_event, finalize_ixn_event,
    finalize_rot_event, find_seal_in_kel, parse_kel_json, replay_kel, serialize_for_signing,
    validate_delegation, validate_for_append, validate_kel, validate_kel_with_lookup,
    validate_kel_with_policy, validate_kel_with_receipts, validate_signed_event,
    verify_event_crypto, verify_event_said,
};

#[cfg(feature = "cesr")]
pub use codec::{CesrCodec, CesrV1Codec, DecodedPrimitive, DigestType, KeyType, SigType};
#[cfg(feature = "cesr")]
pub use event::{SerializedEvent, decode_cesr_key, serialize_for_cesr};
#[cfg(feature = "cesr")]
pub use roundtrip::{export_kel_as_cesr, import_cesr_to_events};
#[cfg(feature = "cesr")]
pub use stream::{AttachmentGroup, CesrStream, assemble_cesr_stream};
#[cfg(feature = "cesr")]
pub use version::compute_version_string;