#![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(
clippy::error_impl_error,
reason = "`Error` is the idiomatic name for the crate's top-level error enum, matching the `thiserror` convention used pervasively in the Rust ecosystem"
)]
#![cfg_attr(
test,
allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
reason = "JSON / byte field indexing via `[\"key\"]` or `[0]` is ergonomic inside tests, and `panic!` / `unwrap()` are the idiomatic way to assert expectations with a failure message when a fixture is wrong"
)
)]
mod cavage;
mod content_digest;
mod digest;
mod error;
mod http_shared;
mod key;
mod policy;
mod rfc9421;
mod verify;
use bytes as _;
use pkcs8 as _;
#[cfg(test)]
use tokio as _;
use tracing as _;
use url as _;
pub use self::cavage::{
CavageHeaderParams, CavageHeaderSet, CavageSigner, CavageVerified, DEFAULT_HEADER_SET,
SIGNATURE_HEADER, cavage_verify, cavage_verify_with_policy,
};
pub use self::content_digest::{
CONTENT_DIGEST_HEADER, DigestAlgorithm, content_digest_header, content_digest_header_with,
verify_any_content_digest_header, verify_content_digest_header,
};
pub use self::digest::{SHA256_DIGEST_PREFIX, sha256_digest_header, verify_digest_header};
pub use self::error::Error;
pub use self::key::{
Algorithm, Ed25519PublicKey, Ed25519SigningKey, Multikey, RsaBits, RsaPublicKey, RsaSigningKey,
SigningKey, VerifyingKey,
};
pub use self::policy::{CAVAGE_REQUIRED_HEADERS, VerifyPolicy};
pub use self::rfc9421::{
Component, DEFAULT_COMPONENTS as RFC9421_DEFAULT_COMPONENTS, Rfc9421Signer, Rfc9421Verified,
SIGNATURE_INPUT_HEADER, SignatureInput, parse_signature_dict, parse_signature_input_dict,
rfc9421_verify, rfc9421_verify_with_policy, serialise_signature_dict,
serialise_signature_input_dict,
};
pub use self::verify::{REDACTED_HEADERS_DEFAULT, Verified, verify, verify_with_policy};
pub type Result<T, E = Error> = core::result::Result<T, E>;