Skip to main content

auths_crypto/
lib.rs

1//! Cryptographic primitives for Auths.
2//!
3//! This crate isolates key parsing, DID encoding, and pluggable verification
4//! from concrete backends, keeping the core dependency-light.
5//!
6//! - [`provider`] — Pluggable [`CryptoProvider`] trait for Ed25519 verification
7//! - [`keri`] — KERI CESR Ed25519 key parsing (`KeriPublicKey`, `KeriDecodeError`)
8//! - [`did_key`] — DID:key ↔ Ed25519 encoding (`DidKeyError`, `did_key_to_ed25519`, etc.)
9
10pub mod did_key;
11pub mod keri;
12pub mod key_material;
13pub mod provider;
14#[cfg(all(feature = "native", not(target_arch = "wasm32")))]
15pub mod ring_provider;
16pub mod ssh;
17#[cfg(feature = "wasm")]
18pub mod webcrypto_provider;
19
20pub use did_key::{
21    DidKeyError, did_key_to_ed25519, ed25519_pubkey_to_did_keri, ed25519_pubkey_to_did_key,
22};
23pub use keri::{KeriDecodeError, KeriPublicKey};
24pub use key_material::{build_ed25519_pkcs8_v2, parse_ed25519_key_material, parse_ed25519_seed};
25pub use provider::{
26    CryptoError, CryptoProvider, ED25519_PUBLIC_KEY_LEN, ED25519_SIGNATURE_LEN, SecureSeed,
27};
28#[cfg(all(feature = "native", not(target_arch = "wasm32")))]
29pub use ring_provider::RingCryptoProvider;
30pub use ssh::{SshKeyError, openssh_pub_to_raw_ed25519};
31#[cfg(all(any(test, feature = "test-utils"), not(target_arch = "wasm32")))]
32pub mod testing;
33
34#[cfg(feature = "wasm")]
35pub use webcrypto_provider::WebCryptoProvider;