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 error;
12pub mod keri;
13pub mod key_material;
14pub mod pkcs8;
15pub mod provider;
16#[cfg(all(feature = "native", not(target_arch = "wasm32")))]
17pub mod ring_provider;
18pub mod ssh;
19#[cfg(feature = "wasm")]
20pub mod webcrypto_provider;
21
22pub use did_key::{
23    DidKeyError, did_key_to_ed25519, ed25519_pubkey_to_did_keri, ed25519_pubkey_to_did_key,
24};
25pub use error::AuthsErrorInfo;
26pub use keri::{KeriDecodeError, KeriPublicKey};
27pub use key_material::{build_ed25519_pkcs8_v2, parse_ed25519_key_material, parse_ed25519_seed};
28pub use pkcs8::Pkcs8Der;
29pub use provider::{
30    CryptoError, CryptoProvider, ED25519_PUBLIC_KEY_LEN, ED25519_SIGNATURE_LEN, SecureSeed,
31};
32#[cfg(all(feature = "native", not(target_arch = "wasm32")))]
33pub use ring_provider::RingCryptoProvider;
34pub use ssh::{SshKeyError, openssh_pub_to_raw_ed25519};
35#[cfg(all(any(test, feature = "test-utils"), not(target_arch = "wasm32")))]
36#[allow(clippy::unwrap_used, clippy::expect_used)]
37pub mod testing;
38
39#[cfg(feature = "wasm")]
40pub use webcrypto_provider::WebCryptoProvider;