Skip to main content

KeylessReason

Enum KeylessReason 

Source
#[non_exhaustive]
pub enum KeylessReason {
Show 20 variants IssuerNotAccepted, TokenInvalid, AudienceMismatch, ConfirmationMismatch, TokenReplayed, IdentityNotAuthorized, PopInvalid, AttestationMissing, AttestationForeign, AttestationNotFound, AttestationMismatch, AttestationWithdrawn, OutsideAttestationWindow, KeylessIdentityMismatch, AttestationInvalid, UntrustedAttester, Unplaceable, InvalidSignature, Revoked, ControllerUnreachable,
}
Expand description

Why a keyless step refused: the registry details.reason tokens (§5.2, §6.3, §7) and the consumer verification results (§8.1).

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.
§

IssuerNotAccepted

§5.2 step 2: the token’s issuer (or SPIFFE trust domain) is not accepted by the registry.

§

TokenInvalid

§5.2 step 3: the token fails verification.

§

AudienceMismatch

§5.2 step 3: the token’s aud lacks the registry’s DID.

§

ConfirmationMismatch

§5.2 step 3: cnf.jkt is not the presented key’s thumbprint.

§

TokenReplayed

§5.2 step 3: the token was already used.

§

IdentityNotAuthorized

§5.2 step 6, §6.3 step 7: the controller does not list the identity.

§

PopInvalid

§5.2 step 4: the proof of possession does not verify.

§

AttestationMissing

§6.3 step 1: a keyless key id with no key_attestation.

§

AttestationForeign

§6.3 step 2: the attestation is on another registry.

§

AttestationNotFound

§6.3 step 3: no attestation at key_attestation.ctx_id.

§

AttestationMismatch

§6.3 steps 3–4, §8.1 step 3: the attestation’s bytes or bindings differ.

§

AttestationWithdrawn

§6.3 step 5, §8.1 step 7: the attestation was retracted.

§

OutsideAttestationWindow

§6.3 step 6, §8.1 step 5: the placing time is outside the window.

§

KeylessIdentityMismatch

§7: the successor’s identity may not supersede the predecessor.

§

AttestationInvalid

§8.1 step 1: the attestation does not verify or breaks §5.3.

§

UntrustedAttester

§8.1 step 2: the consumer does not accept the attesting registry.

§

Unplaceable

§8.1 step 4: no receipt by the attester places the signature.

§

InvalidSignature

§8.1 step 6: the signature does not verify under the attested key.

§

Revoked

§8.1 step 8: a revocation of the attested key applies.

§

ControllerUnreachable

§8.1 step 9: the controller’s DID document could not be fetched.

Implementations§

Source§

impl KeylessReason

Source

pub const ALL: [KeylessReason; 20]

Every reason, in declaration order.

Source

pub fn as_str(self) -> &'static str

The token as written on the wire and in reports.

Source

pub fn parse(token: &str) -> Option<KeylessReason>

Parse a token.

Source

pub fn is_registry_token(self) -> bool

True for the tokens registries/error-codes.md lists as registry details.reason values (the rest are consumer results, §13.3).

Source

pub fn tag(self, message: impl Display) -> String

message with this reason’s prefix.

Source

pub fn error(self, message: impl Display) -> AcdpError

The consumer-side error for this reason (§8.1, §8.2): the existing variant whose meaning fits, with the reason prefix. controller_unreachable is the one transient refusal.

Source

pub fn of(error: &AcdpError) -> Option<KeylessReason>

The keyless reason an error carries, if any. A AcdpError::KeyRevoked reads as Self::Revoked: keyless verification refuses a revoked key with that typed error.

Trait Implementations§

Source§

impl Clone for KeylessReason

Source§

fn clone(&self) -> KeylessReason

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 KeylessReason

Source§

impl Debug for KeylessReason

Source§

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

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

impl<'de> Deserialize<'de> for KeylessReason

Source§

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

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

impl Display for KeylessReason

Source§

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

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

impl Eq for KeylessReason

Source§

impl Hash for KeylessReason

Source§

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

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 KeylessReason

Source§

fn eq(&self, other: &KeylessReason) -> 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 KeylessReason

Source§

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

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

impl StructuralPartialEq for KeylessReason

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.