Skip to main content

VerificationReport

Struct VerificationReport 

Source
pub struct VerificationReport {
    pub status: VerificationStatus,
    pub chain: Vec<ChainLink>,
    pub warnings: Vec<String>,
    pub witness_quorum: Option<WitnessQuorum>,
    pub anchored: Option<AnchorStatus>,
    pub duplicity_warning: Option<DuplicityReport>,
    pub freshness: Freshness,
    pub as_of: Option<u128>,
}
Expand description

Machine-readable verification result containing status, chain details, and warnings.

Fields§

§status: VerificationStatus

The overall verification status

§chain: Vec<ChainLink>

Details of each link in the verification chain

§warnings: Vec<String>

Non-fatal warnings encountered during verification

§witness_quorum: Option<WitnessQuorum>

Optional witness quorum result (present when witness verification was performed)

§anchored: Option<AnchorStatus>

Whether the attestation is anchored in a verifiable log: the issuer’s KEL via an ixn seal, or a transparency log via an offline inclusion proof verified under a pinned log key.

§duplicity_warning: Option<DuplicityReport>

Structured duplicity warning from the shared-KEL detector.

Fail-closed: a Some(Diverging { … }) warning makes VerificationReport::is_valid return false even though status still records that the attestation signature verified — a forked KEL is not trustworthy. The structured warning also lets CLI / iOS / CI render a banner and point the user at auths device remove to resolve.

None indicates no divergence was observed (or no shared-KEL replay was performed).

§freshness: Freshness

How fresh this verdict is under the verifier’s freshness model (ADR 009). The chain verifier reads no clock and no network, so an offline verify (no fresher source supplied) names Freshness::Unknown — the report is never a bare Valid that reads as real-time fresh. A caller that has a fresher source upgrades it via VerificationReport::with_freshness. #[serde(default)] resolves a missing field to Unknown so pre-field JSON still loads.

§as_of: Option<u128>

The KEL position this verdict was verified as-of (ADR 009, the {as_of, freshness} pair): the issuer-KEL tip (seq) the chain was checked against, when the caller supplies one. The pure chain verifier reads no KEL tip, so it leaves this None (“position unknown”) — honest, never fabricated; a caller holding the slice position stamps it via VerificationReport::with_as_of. #[serde(default)] keeps pre-field JSON loadable.

Implementations§

Source§

impl VerificationReport

Source

pub fn is_valid(&self) -> bool

Returns true only when the signature status is Valid and no duplicity warning is present. Fail-closed: a valid signature on a KEL that has forked (Some(Diverging)) is not trustworthy, so the trust decision refuses even though status records the signature as valid.

Source

pub fn valid(chain: Vec<ChainLink>) -> Self

Creates a new valid VerificationReport with the given chain.

Freshness defaults to Freshness::Unknown: the chain verifier consults no fresher source, so an offline verify is honestly unconfirmable, never silently fresh. A caller holding a fresher source upgrades it with VerificationReport::with_freshness.

Source

pub fn with_status(status: VerificationStatus, chain: Vec<ChainLink>) -> Self

Creates a new VerificationReport with the given status and chain.

Freshness defaults to Freshness::Unknown (offline, unconfirmable) — see VerificationReport::valid.

Source

pub fn with_duplicity_warning(self, warning: DuplicityReport) -> Self

Attach a duplicity warning to this report. Leaves status (the signature verdict) unchanged, but makes VerificationReport::is_valid fail closed — a diverging shared KEL is not trustworthy even when the per-attestation signature verified.

Source

pub fn freshness(&self) -> Freshness

The freshness this report names (ADR 009). An offline verify is Freshness::Unknown; a report built with a fresher source carries its classified grade.

Source

pub fn with_freshness(self, freshness: Freshness) -> Self

Re-stamp this report’s freshness from a fresher-source classification.

The chain verifier itself reads no clock/network, so it always emits Unknown. A caller that holds a fresher source (a witness head, a transparency-log tip) classifies it through crate::freshness::FreshnessPolicy and stamps the grade here, so the surfaced verdict stays honest about what was confirmed.

Args:

  • freshness: the classified freshness of this otherwise-valid report.
Source

pub fn as_of(&self) -> Option<u128>

The KEL position this report was verified as-of (ADR 009), or None when the pure chain verifier was given no slice position to report.

Source

pub fn with_as_of(self, as_of: u128) -> Self

Stamp the issuer-KEL slice position this report was verified as-of. Pairs with VerificationReport::with_freshness: a caller holding the verified slice records both how current (as_of) and how fresh (freshness) the otherwise-valid report is.

Args:

  • as_of: the issuer-KEL tip (seq) the chain was verified against.

Trait Implementations§

Source§

impl Clone for VerificationReport

Source§

fn clone(&self) -> VerificationReport

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 VerificationReport

Source§

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

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

impl<'de> Deserialize<'de> for VerificationReport

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 PartialEq for VerificationReport

Source§

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

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 VerificationReport

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