Skip to main content

BundleTrust

Struct BundleTrust 

Source
pub struct BundleTrust { /* private fields */ }
Expand description

A parsed, authenticated trust anchor extracted from an identity bundle.

Constructing one (BundleTrust::parse) proves three things, so callers never re-check them:

  1. Freshness — the bundle is within its own TTL.
  2. Self-certification (RT-005) — the bundle’s identity_did names the inception event its KEL carries (SAID for E… prefixes, controller field otherwise), so a bundle cannot pair a victim’s DID with an attacker-authored KEL.
  3. KEL authentication (RT-002) — every KEL event is signed by its controlling key-state, verified via validate_signed_kel; a stripped or forged attachment fails closed here.

The bundle is evidence for a pinned root, never the source of the pin: callers must still require BundleTrust::root_did to be in their independently pinned root set.

Implementations§

Source§

impl BundleTrust

Source

pub fn parse( bundle: &IdentityBundle, now: DateTime<Utc>, ) -> Result<Self, BundleTrustError>

Parse a bundle into a trust anchor: freshness + RT-005 + RT-002.

Args:

  • bundle: The deserialized identity bundle (attacker-controlled input).
  • now: Current time, injected at the boundary.

Usage:

let trust = BundleTrust::parse(&bundle, Utc::now())?;
assert!(pinned_roots.contains(&trust.root_did().to_string()));
Source

pub fn root_did(&self) -> &str

The root did:keri: this bundle self-certifies to. Evidence for a pin, never the pin itself.

Source

pub fn kel(&self) -> &[Event]

The authenticated KEL events, oldest first.

Source

pub fn device_kels(&self) -> &[AuthenticatedDeviceKel]

The authenticated device KELs — (did, events) per delegated device the bundle carries, each seal-checked against the root KEL.

Source

pub fn into_parts(self) -> (String, Vec<Event>, Vec<AuthenticatedDeviceKel>)

Consume the anchor into (root_did, kel, device_kels) for callers that thread the parts separately (the CLI’s stateless resolver).

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