Skip to main content

aitp_tct/
lib.rs

1//! Trust Context Token (TCT) — the canonical output of AITP.
2//!
3//! A TCT is a signed, audience-bound, capability-scoped grant. Each peer
4//! holds the TCT issued by its counterpart in a Mutual Handshake.
5//!
6//! In `aitp/0.2` the TCT and its companion grant voucher are **compact
7//! JWS strings** (RFC-AITP-0001 §5.4.5): signatures cover the exact
8//! transmitted bytes, so any off-the-shelf JOSE library can verify them
9//! given only the issuer public key. The revocation snapshot
10//! (RFC-AITP-0008) is protocol-internal and stays JCS-signed.
11
12#![forbid(unsafe_code)]
13#![warn(missing_docs)]
14
15pub mod builder;
16pub mod error;
17pub mod pop;
18/// In-band TCT renewal (RFC-AITP-0004 §8.1, post-v0.1). Gated behind
19/// the `experimental-renewal` Cargo feature — v0.1 deployments MUST
20/// re-run the Mutual Handshake instead.
21#[cfg(feature = "experimental-renewal")]
22pub mod renewal;
23pub mod revocation;
24pub mod types;
25pub mod verifier;
26
27pub use builder::TctBuilder;
28pub use error::TctError;
29pub use pop::{sign_pop_response, verify_pop_response, PopChallenge, PopResponse};
30#[cfg(feature = "experimental-renewal")]
31pub use renewal::{build_renewal_request, process_renewal_request};
32pub use revocation::{
33    sign_revocation_list, verify_revocation_list, RevocationEntry, RevocationList,
34    RevocationListEnvelope, VerifyRevocationListContext,
35};
36#[cfg(feature = "experimental-renewal")]
37pub use types::TctRenewalPayload;
38pub use types::{Cnf, GrantVoucherClaims, IssuedTct, TctClaims, VerifiedTct};
39pub use verifier::{verify_tct, verify_voucher, TctVerifyContext};
40
41/// Recommended TCT TTL (1 hour).
42pub const DEFAULT_TCT_TTL_SECS: i64 = 3600;