Skip to main content

KeyResolver

Trait KeyResolver 

Source
pub trait KeyResolver: Send + Sync {
    // Required method
    fn resolve_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 KeyReference,
        role: KeyRole,
    ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Finds the public key a KeyReference names.

Resolver implements it for DID URLs, JwkResolver for keys by value and, with the jwks feature, JwksResolver for the key sets of HTTPS issuers; CompositeKeyResolver combines them. An application can implement it over a cache, a fixed set of trusted keys, or a reference the crate does not resolve.

Required Methods§

Source

fn resolve_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 KeyReference, role: KeyRole, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The public key key names, usable in role.

§Errors

KeyResolutionError::Unsupported for a kind of reference this resolver does not handle, which lets a CompositeKeyResolver try the next one; any other KeyResolutionError when the key cannot be found or used.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: KeyResolver + ?Sized> KeyResolver for &T

Source§

fn resolve_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 KeyReference, role: KeyRole, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<T: KeyResolver + ?Sized> KeyResolver for Arc<T>

Source§

fn resolve_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 KeyReference, role: KeyRole, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<T: KeyResolver + ?Sized> KeyResolver for Box<T>

Source§

fn resolve_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 KeyReference, role: KeyRole, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl KeyResolver for CompositeKeyResolver

Source§

impl KeyResolver for JwkResolver

Source§

impl KeyResolver for Resolver

Resolves a KeyReference::DidUrl by dereferencing it to a verification method listed under the relationship of the role; every other reference is Unsupported.

Source§

impl<C: HttpClient> KeyResolver for JwksResolver<C>

Available on crate feature jwks only.