Skip to main content

SelfSignedVerifier

Trait SelfSignedVerifier 

Source
pub trait SelfSignedVerifier: Send + Sync {
    // Required methods
    fn verify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        envelope: &'life1 ProofEnvelope<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VerifiedSubject>, SelfSignedError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &'static str;
}
Expand description

Verifier for a single self-signed proof format.

Implementations MUST be inexpensive to clone behind an Arc and MUST be Send + Sync so they can live inside a request-scoped dispatcher.

Required Methods§

Source

fn verify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, envelope: &'life1 ProofEnvelope<'life2>, ) -> Pin<Box<dyn Future<Output = Result<Option<VerifiedSubject>, SelfSignedError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Attempt to verify the proof. Returns Ok(Some(subject)) on a successful verification, Ok(None) if the proof does not match this verifier’s format (allows the fan-out dispatcher to try the next one), or Err(…) when the format matches but verification fails — in which case the fan-out stops.

Source

fn name(&self) -> &'static str

Short name for diagnostics / metrics ("did:key", "nip98", …).

Implementors§