Skip to main content

VerificationOutcome

Enum VerificationOutcome 

Source
#[non_exhaustive]
pub enum VerificationOutcome { Verified { badge: Badge, matched_fingerprint: CertFingerprint, }, NotAnsAgent { fqdn: String, }, InvalidStatus { status: BadgeStatus, badge: Badge, }, FingerprintMismatch { expected: String, actual: String, badge: Badge, }, HostnameMismatch { expected: String, actual: String, badge: Badge, }, AnsNameMismatch { expected: String, actual: String, badge: Badge, }, DnsError(DnsError), TlogError(TlogError), CertError(CryptoError), ParseError(ParseError), DaneError(DaneError), }
Expand description

Result of a verification operation.

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

Verified

Verification passed.

Fields

§badge: Badge

The verified badge.

§matched_fingerprint: CertFingerprint

The fingerprint that matched.

§

NotAnsAgent

Not an ANS agent (no badge DNS record found).

Fields

§fqdn: String

The FQDN that was looked up.

§

InvalidStatus

Badge status is invalid for connections.

Fields

§status: BadgeStatus

The invalid status.

§badge: Badge

The badge with invalid status.

§

FingerprintMismatch

Certificate fingerprint does not match badge.

Fields

§expected: String

Expected fingerprint from badge.

§actual: String

Actual fingerprint from certificate.

§badge: Badge

The badge that didn’t match.

§

HostnameMismatch

Hostname does not match badge.

Fields

§expected: String

Expected hostname from badge.

§actual: String

Actual hostname from certificate.

§badge: Badge

The badge that didn’t match.

§

AnsNameMismatch

ANS name does not match badge (mTLS client verification).

Fields

§expected: String

Expected ANS name from badge.

§actual: String

Actual ANS name from certificate.

§badge: Badge

The badge that didn’t match.

§

DnsError(DnsError)

Verification failed due to a DNS error.

§

TlogError(TlogError)

Verification failed due to a transparency log error.

§

CertError(CryptoError)

Verification failed due to a certificate error.

§

ParseError(ParseError)

Verification failed due to a parse error.

§

DaneError(DaneError)

Verification failed due to a DANE/TLSA error.

Implementations§

Source§

impl VerificationOutcome

Source

pub fn is_success(&self) -> bool

Check if verification was successful.

Source

pub fn is_terminal_status(&self) -> bool

Check if the agent is in a terminal status (revoked, expired, etc.).

Returns true for both badge-detected terminal status ([InvalidStatus]) and SCITT-detected terminal status ([ScittError::TerminalStatus] / [ScittError::AgentTerminal]). Callers should use this instead of pattern-matching individual variants.

Source

pub fn is_not_ans_agent(&self) -> bool

Check if the agent is not registered with ANS.

Source

pub fn badge(&self) -> Option<&Badge>

Get the badge if verification succeeded or partially completed.

Source

pub fn into_result(self) -> AnsResult<Badge>

Convert to a Result, returning the Badge on success.

For badge-based verification, this is the natural accessor. For SCITT-verified outcomes that may not carry a badge, prefer into_scitt_result which returns Option<Badge> on success.

When the scitt feature is enabled:

  • ScittVerified with a badge → Ok(badge)
  • ScittVerified without a badge → Err(Configuration) (use into_scitt_result() instead)
  • ScittErrorErr(Scitt(..))

Trait Implementations§

Source§

impl Debug for VerificationOutcome

Source§

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

Formats the value using the given formatter. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more