Skip to main content

CredentialVerdict

Enum CredentialVerdict 

Source
pub enum CredentialVerdict {
    Valid {
        issuer: IdentityDID,
        subject: CanonicalDid,
        caps: Vec<Capability>,
        as_of: u128,
    },
    SaidMismatch,
    SchemaInvalid,
    IssuerSignatureInvalid,
    RegistryNotEstablished,
    CredentialRevoked {
        revoked_at: u128,
    },
    Expired {
        expired_at: DateTime<Utc>,
        now: DateTime<Utc>,
    },
    WitnessQuorumNotMet {
        event: LifecycleEvent,
        collected: usize,
        required: usize,
    },
    IssuerKelDuplicitous,
}
Expand description

The distinguishable outcome of verify_credential.

Every failure is a named variant so a consumer can explain why a credential did not verify, never a generic “invalid”.

Variants§

§

Valid

The credential is authentic, anchored, witnessed (per policy), unexpired, and not revoked at/before the presentation position.

Fields

§issuer: IdentityDID

Issuer AID (did:keri:), parsed once at construction.

§subject: CanonicalDid

Subject (holder) AID (did:keri:), parsed once at construction.

§caps: Vec<Capability>

The capabilities the credential grants (a.capability), parsed once — a capability that does not parse fails the verdict closed (never silently dropped).

§as_of: u128

The KEL position the verdict is as-of: the tip (seq) of the given issuer KEL.

§

SaidMismatch

The recomputed ACDC d (or nested a.d) did not match the embedded SAID.

§

SchemaInvalid

The attributes failed validation against the embedded capability schema, or the schema SAID s is not the pinned one.

§

IssuerSignatureInvalid

The issuance was not anchored, or its issuer signature did not verify against the signing-time key.

§

RegistryNotEstablished

The registry (vcp) was never anchored in the issuer KEL, so status is unknown.

§

CredentialRevoked

A revocation reached the policy bar and is anchored at/before the presentation.

Fields

§revoked_at: u128

The KEL position at which the revocation was anchored.

§

Expired

The credential expired at expired_at, checked against the injected now.

Fields

§expired_at: DateTime<Utc>

The expiry instant declared in a.expiry.

§now: DateTime<Utc>

The injected verification time it was checked against.

§

WitnessQuorumNotMet

Under VerifierWitnessPolicy::RequireWitnesses a lifecycle anchor did not reach witness quorum (fail-closed). Names which anchor missed.

Fields

§event: LifecycleEvent

Which lifecycle anchor (vcp/iss/rev) missed quorum.

§collected: usize

Distinct valid designated-witness receipts collected for that anchor.

§required: usize

Receipts required by the in-force backer threshold at that anchor.

§

IssuerKelDuplicitous

The issuer KEL forks (two events at one seq with different SAIDs) — fail-closed in both witness policies.

Implementations§

Source§

impl CredentialVerdict

Source

pub fn is_valid(&self) -> bool

Whether the credential verified (Valid).

Trait Implementations§

Source§

impl Clone for CredentialVerdict

Source§

fn clone(&self) -> CredentialVerdict

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 Debug for CredentialVerdict

Source§

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

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

impl Eq for CredentialVerdict

Source§

impl PartialEq for CredentialVerdict

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CredentialVerdict

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