Skip to main content

KeyResolver

Trait KeyResolver 

Source
pub trait KeyResolver: Send + Sync {
    // Required method
    fn resolve_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 DidUrl,
        relationship: VerificationRelationship,
    ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Available on crate feature vc only.
Expand description

Finds the public key a JWT was signed with, given the DID URL in its kid.

Resolver implements it by dereferencing the URL; an application can implement it over a cache, a JWKS, or a fixed set of trusted keys.

Required Methods§

Source

fn resolve_key<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 DidUrl, relationship: VerificationRelationship, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The public key of the verification method url names, which must be usable for relationship: assertionMethod for a credential, authentication for a presentation.

§Errors

A KeyResolutionError when the DID does not resolve, the method does not exist or is not usable for relationship, or its material cannot be read as a JWK.

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, url: &'life1 DidUrl, relationship: VerificationRelationship, ) -> 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, url: &'life1 DidUrl, relationship: VerificationRelationship, ) -> 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, url: &'life1 DidUrl, relationship: VerificationRelationship, ) -> Pin<Box<dyn Future<Output = Result<Jwk, KeyResolutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§