1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Core types and primitives for the Agent Identity & Trust Protocol (AITP).
//!
//! This crate is pure — no I/O, no crypto, no transport. It defines:
//!
//! - The [`Aid`] newtype: a validated AITP Agent Identifier.
//! - The [`AitpEnvelope`] message wrapper.
//! - JSON canonicalization per RFC 8785 ([`jcs`]).
//! - Strict unpadded base64url codec ([`base64url`]).
//! - The [`Timestamp`] newtype for Unix-second timestamps.
//! - The [`ExtensionsMap`] type for forward-compatible extensions.
//! - The [`AitpError`] and [`ErrorCode`] taxonomy from RFC-AITP-0001.
//!
//! Higher-level protocol crates (`aitp-manifest`, `aitp-tct`, `aitp-handshake`,
//! `aitp-delegation`) build on these primitives.
pub use ;
pub use ;
pub use ;
pub use ExtensionsMap;
pub use RawUrl;
pub use Timestamp;
/// Protocol version this crate implements. Carried as the `version`
/// field on JCS-profile artifacts and as the `ver` private claim on
/// compact-JWS portable trust artifacts (RFC-AITP-0001 §5.4.5).
pub const PROTOCOL_VERSION: &str = "aitp/0.2";
/// Default timestamp tolerance for replay protection (300 seconds, ±).
pub const DEFAULT_TIMESTAMP_TOLERANCE_SECS: i64 = 300;
/// Length of an AID identifier component when method = `pubkey`
/// (Ed25519 raw public key encoded as unpadded base64url).
pub const AID_PUBKEY_IDENTIFIER_LEN: usize = 43;
/// Length of an Ed25519 signature encoded as unpadded base64url.
pub const ED25519_SIGNATURE_BASE64URL_LEN: usize = 86;