Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> ErrorCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorCode

Source§

impl Debug for ErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorCode

Source§

fn eq(&self, other: &ErrorCode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.