Skip to main content

adk_awp/signing/
mod.rs

1//! AWP 2.0 signatures (feature `signing`; spec 3.5 §7.2, §7.7, D-11, A-I5).
2//!
3//! | Module | Contents | AWP 2.0 |
4//! |---|---|---|
5//! | [`jws`] | Detached JWS (EdDSA) over the JCS form of a document without `proof`; `DocumentSigner`; digests and RFC 7638 thumbprints | §5.1, §5.4, §1.2 |
6//! | [`keys`] | Delegations, revocations, root endorsement; verifying a key set; the key for a scope and date | §5.2–§5.5, §5.7 |
7//! | [`anchor`] | The `_awp-root` DNS record and `DnsTxtResolver` | §5.6 |
8//! | [`card`] | Signed A2A Agent Cards | §7.4.2 |
9//! | [`log`] | The site log's entries, tiles and signed checkpoint | §14.5 |
10//! | [`bundle`] | `StaticBundle`: the signed contract, `keys.json` and public terms | §4, §13.2 |
11//!
12//! JCS, Ed25519 and signed notes come from `adk-auth`. Keys never appear in `Debug`, errors or
13//! logs (A-I5).
14
15pub mod anchor;
16pub mod bundle;
17pub mod card;
18pub mod jws;
19pub mod keys;
20pub mod log;
21
22/// Why a document could not be signed (spec 3.5 §7.2).
23#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
24#[non_exhaustive]
25pub enum SigningError {
26    /// The document is not I-JSON.
27    #[error("the document cannot be canonicalised: {0}")]
28    Canonicalize(String),
29    /// The key is invalid or could not sign.
30    #[error("the signing key failed: {0}")]
31    Key(String),
32    /// A log tile or entry bundle is malformed.
33    #[error("a log tile is malformed: {0}")]
34    Tile(String),
35}