Skip to main content

At9pCapsuleResolver

Trait At9pCapsuleResolver 

Source
pub trait At9pCapsuleResolver: Send + Sync {
    // Provided methods
    fn verify_bytes(
        &self,
        did: &str,
        capsule_bytes: &[u8],
    ) -> Result<VerifiedAt9pKeys> { ... }
    fn resolve(&self, did: &str) -> Result<VerifiedAt9pKeys> { ... }
}
Expand description

Verifies a did:at9p capsule and yields its content-verified subject keys.

The A4 GATE pipeline (canon-gate → hash-gate(H512 == cid512) → sig-gate, #884) lives in hyprstream-pds beside the capsule schema. The lower hyprstream-rpc crate — which both the admission gate (crate::admission) and this resolver belong to — cannot depend on pds, so the GATE is abstracted behind this object-safe trait and implemented in pds over hyprstream_pds::at9p_gate::verify_did_at9p.

Two entry points, each fail-closed on any GATE failure (never a default-Ok):

  • verify_bytes — the admission path: the peer presented its capsule bytes over the channel; the GATE decides whether to accept them. Used by admit_key_against_did’s did:at9p arm to bind the verified hybrid keys into the crate::envelope::KeyedPqTrustStore (#894).
  • resolve — the resolver path: fetch the capsule bytes for did from the (untrusted) mainline locator (#890, Track C) and GATE-verify them. Used by this module’s did:at9p arm to derive PqHybrid assurance.

The default impls return Err so a configuration that supplies only one path (admission today; the locator is not wired) leaves the other fail-closed rather than silently degrading.

Provided Methods§

Source

fn verify_bytes( &self, did: &str, capsule_bytes: &[u8], ) -> Result<VerifiedAt9pKeys>

GATE-verify capsule_bytes the peer presented for did:at9p:<cid512> (admission path). Pure over the bytes — no fetch, no I/O.

Source

fn resolve(&self, did: &str) -> Result<VerifiedAt9pKeys>

Fetch the capsule for did from the untrusted locator and GATE-verify it (resolver path). The locator itself is Track C (#890); until it is wired an honest implementation returns Err.

Implementors§