Skip to main content

UcanVerifier

Trait UcanVerifier 

Source
pub trait UcanVerifier {
    // Required method
    fn verify(
        &self,
        issuer: &Did,
        ed_key: &[u8; 32],
        payload: &[u8],
        signature: &[u8],
    ) -> Result<(), UcanError>;
}
Expand description

Resolves a UCAN issuer’s verified key material and checks a detached hybrid-COSE signature over the payload bytes.

This is the seam between “what DID/key-binding layer says is anchored” and “what the UCAN verifier trusts”. The production implementor resolves the issuer’s anchored ML-DSA-65 verifying key (via the register_pq_trust / PqTrustStore binding referenced in crypto::cose_sign) keyed by the issuer’s Ed25519 identity and calls crate::crypto::cose_sign::verify_composite with require_pq = true. The classical Ed25519 key is supplied (already decoded from the did:key).

Required Methods§

Source

fn verify( &self, issuer: &Did, ed_key: &[u8; 32], payload: &[u8], signature: &[u8], ) -> Result<(), UcanError>

Verify signature (a hybrid-COSE composite) over payload for the given issuer, whose decoded Ed25519 verifying key bytes are ed_key. Returns Ok(()) iff the composite verifies under the project’s hybrid policy (both EdDSA and the anchored ML-DSA-65 layer). Fail-closed otherwise.

Implementations on Foreign Types§

Source§

impl<V: UcanVerifier + ?Sized> UcanVerifier for &V

Source§

fn verify( &self, issuer: &Did, ed_key: &[u8; 32], payload: &[u8], signature: &[u8], ) -> Result<(), UcanError>

Source§

impl<V: UcanVerifier + ?Sized> UcanVerifier for Box<V>

Source§

fn verify( &self, issuer: &Did, ed_key: &[u8; 32], payload: &[u8], signature: &[u8], ) -> Result<(), UcanError>

Implementors§