pub struct CidVerifier { /* private fields */ }Expand description
Fan-out dispatcher — tries each inner verifier in order. The first
one returning Ok(Some(_)) wins. Any Err(_) short-circuits with
that error so a broken-but-matching proof surfaces a precise
diagnostic rather than being masked as UnrecognisedFormat.
Implementations§
Source§impl CidVerifier
impl CidVerifier
Sourcepub fn new() -> Self
pub fn new() -> Self
Build an empty dispatcher; use CidVerifier::with to register
verifiers.
Sourcepub fn with(self, verifier: Arc<dyn SelfSignedVerifier>) -> Self
pub fn with(self, verifier: Arc<dyn SelfSignedVerifier>) -> Self
Register another inner verifier. Verifiers are tried in the order they are added.
pub fn is_empty(&self) -> bool
Sourcepub fn registered(&self) -> Vec<&'static str>
pub fn registered(&self) -> Vec<&'static str>
Names of the registered inner verifiers — used by the WAC issuer condition layer to echo supported CID methods in 422 responses.
Trait Implementations§
Source§impl Default for CidVerifier
impl Default for CidVerifier
Source§impl SelfSignedVerifier for CidVerifier
impl SelfSignedVerifier for CidVerifier
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,
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.Auto Trait Implementations§
impl Freeze for CidVerifier
impl !RefUnwindSafe for CidVerifier
impl Send for CidVerifier
impl Sync for CidVerifier
impl Unpin for CidVerifier
impl UnsafeUnpin for CidVerifier
impl !UnwindSafe for CidVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more