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§
Sourcefn 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,
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
impl<T: KeyResolver + ?Sized> KeyResolver for &T
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>
impl<T: KeyResolver + ?Sized> KeyResolver for Arc<T>
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>
impl<T: KeyResolver + ?Sized> KeyResolver for Box<T>
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§
impl KeyResolver for CompositeKeyResolver
impl KeyResolver for JwkResolver
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.
impl<C: HttpClient> KeyResolver for JwksResolver<C>
jwks only.