Skip to main content

IdentityResolver

Trait IdentityResolver 

Source
pub trait IdentityResolver: Send + Sync {
    // Required method
    fn resolve_identity(
        &self,
        did: &str,
    ) -> impl Future<Output = Result<ResolvedIdentity, ResolutionError>> + Send;
}
Expand description

Resolves a decentralized identifier to its current cryptographic material.

Implementations may fetch data from local stores, remote registries, or peer-to-peer networks. The domain only provides a DID string and receives the resolved key material.

Usage:

use auths_core::ports::network::IdentityResolver;

async fn verify_signer(resolver: &dyn IdentityResolver, did: &str) -> Vec<u8> {
    let resolved = resolver.resolve_identity(did).await.unwrap();
    resolved.public_key
}

Required Methods§

Source

fn resolve_identity( &self, did: &str, ) -> impl Future<Output = Result<ResolvedIdentity, ResolutionError>> + Send

Resolves a DID string to its current public key and method metadata.

Args:

  • did: The decentralized identifier to resolve (e.g., "did:keri:EAbcdef...").

Usage:

let identity = resolver.resolve_identity("did:key:z6Mk...").await?;

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§