#[non_exhaustive]pub enum ErrorCode {
Show 49 variants
InvalidEnvelope,
InvalidSignature,
ReplayDetected,
TimestampExpired,
UnknownVersion,
TokenAlgMismatch,
TokenTypMismatch,
IdentityFailed,
ManifestExpired,
ManifestSignatureInvalid,
ManifestPopFailed,
ManifestVersionUnknown,
TrustFailed,
PolicyViolation,
KeyResolutionFailed,
IncompatibleTrustAnchors,
PopVerificationFailed,
NonceMismatch,
AudienceMismatch,
GrantOverflow,
InsufficientGrants,
HandshakeModeUnsupported,
TctExpired,
PopChallengeInvalid,
PopResponseInvalid,
DelegationAudienceMismatch,
DelegationScopeExceeded,
DelegationInvalidVoucher,
DelegationSourceTctRevoked,
DelegationInvalidSignature,
DelegationExpired,
DelegationPopFailed,
DelegationMultihopNotSupported,
DelegationHopLimitExceeded,
DelegationChainHashMismatch,
ManifestNotFound,
TctSignatureInvalid,
TctRevoked,
TctExpiresAfterManifest,
BundleInvalidSignature,
BundleVersionMismatch,
BundleExpired,
BundleExpiryWindowInvariant,
BundleCoordinatorIssuerMismatch,
BundleAudienceMismatch,
BundleEmptyParticipants,
BundleParticipantTctInvalid,
BundleNotMember,
SessionBundleInvalid,
}Expand description
Wire-level error code as it appears on the protocol.
Serialized as SCREAMING_SNAKE_CASE strings matching the registry.
Marked #[non_exhaustive] so new codes added to the spec’s error
registry can ship in a future minor version without breaking
downstream match statements. Downstream matches must include a
fall-through arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidEnvelope
Envelope JSON failed schema validation.
InvalidSignature
Envelope signature did not verify.
ReplayDetected
Duplicate message_id seen.
TimestampExpired
Timestamp outside ±300s tolerance.
UnknownVersion
Protocol version not supported.
TokenAlgMismatch
Compact-JWS header alg is not the sole value derived from the
signer’s AID — including none in any capitalization and unknown
algorithms (RFC-AITP-0001 §5.4.5).
TokenTypMismatch
Compact-JWS header typ does not exactly match the value expected
for the verification context (aitp-tct+jwt, aitp-grant+jwt, or
aitp-delegation+jwt) (RFC-AITP-0001 §5.4.5).
IdentityFailed
Identity binding could not be verified.
ManifestExpired
Manifest expires_at is in the past.
ManifestSignatureInvalid
Manifest signature did not verify.
ManifestPopFailed
Manifest proof-of-possession did not verify.
ManifestVersionUnknown
Manifest version not supported by this implementation.
TrustFailed
Trust evaluation failed for an unspecified policy reason.
PolicyViolation
Requested capability not granted.
KeyResolutionFailed
Issuer’s keys could not be resolved.
IncompatibleTrustAnchors
Peer’s identity issuer is not in this peer’s trust anchors.
PopVerificationFailed
PoP signature in MUTUAL_COMMIT/_ACK did not verify.
NonceMismatch
pop_nonce_echo did not match the previously sent nonce.
AudienceMismatch
Peer-issued TCT audience did not equal own AID.
GrantOverflow
Peer-issued TCT grants exceed peer’s offered_capabilities.
InsufficientGrants
Received TCT did not include required peer capabilities.
HandshakeModeUnsupported
Proposed handshake_mode not supported.
TctExpired
TCT expires_at is in the past.
PopChallengeInvalid
Downstream PoP challenge was malformed or stale.
PopResponseInvalid
Downstream PoP response did not verify.
DelegationAudienceMismatch
Delegation token: audience did not match self AID.
DelegationScopeExceeded
Delegation token: scope contained capabilities outside grant_proof.
DelegationInvalidVoucher
Delegation token: embedded voucher JWS signature invalid,
voucher.iss ≠ verifier’s AID, or voucher.sub ≠ outer iss.
Renamed in v0.2 from DELEGATION_INVALID_GRANT_PROOF (the
grant_proof reconstruction mechanism was removed by the JWS
migration).
DelegationSourceTctRevoked
Delegation token: source TCT has been revoked.
DelegationInvalidSignature
Delegation token: signature did not verify.
DelegationExpired
Delegation token: token or grant proof has expired.
DelegationPopFailed
Delegation token: PoP binding (cnf) verification failed.
DelegationMultihopNotSupported
Delegation token: chain length exceeds v0.1 single-hop limit.
DelegationHopLimitExceeded
Multi-hop delegation: chain length exceeds max_delegation_hops
(RFC-AITP-0011).
DelegationChainHashMismatch
Multi-hop delegation: chain_hash does not match the chain
array contents (truncation or tampering detected — RFC-AITP-0011).
ManifestNotFound
Manifest service: no manifest for the requested AID.
TctSignatureInvalid
TCT verification: signature did not validate under issuer’s key.
TctRevoked
TCT verification: jti is in issuer’s deny list.
TctExpiresAfterManifest
TCT verification: TCT expires_at exceeds the issuing peer’s
Manifest expires_at (RFC-AITP-0004 §4.3).
BundleInvalidSignature
Coordinator’s outer bundle signature failed verification under the coordinator’s Manifest key.
BundleVersionMismatch
version is not "aitp/0.2" (or a later supported version).
BundleExpired
Bundle expires_at is in the past at verification time.
BundleExpiryWindowInvariant
expires_at is greater than
min(participants[*].tct.expires_at) (RFC-AITP-0010 §6).
BundleCoordinatorIssuerMismatch
One or more participants[*].tct.issuer values do not equal
coordinator.
BundleAudienceMismatch
A participants[i].tct.audience does not equal
participants[i].aid.
BundleEmptyParticipants
participants array is empty.
BundleParticipantTctInvalid
At least one embedded participant TCT failed standard TCT verification.
BundleNotMember
Receiver’s AID is not in participants[*].aid.
SessionBundleInvalid
Aggregate fallback — implementations MAY return this when a deployment policy requires a single-error surface for bundles, in lieu of the specific BUNDLE_* codes above.
Trait Implementations§
impl Copy for ErrorCode
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.