pub trait DidResolver: Send + Sync {
// Required method
fn resolve(&self, did: &str) -> Result<ResolvedDid, DidResolverError>;
}Expand description
Resolves a Decentralized Identifier (DID) to its cryptographic material.
Implementations handle specific DID methods (did:key, did:keri) and return the resolved public key along with method-specific metadata. The resolver abstracts away the underlying storage and network access needed for resolution.
Args:
did: A DID string (e.g.,"did:keri:EABC..."or"did:key:z6Mk...").
Usage:
ⓘ
use auths_core::signing::DidResolver;
fn verify_attestation(resolver: &dyn DidResolver, issuer_did: &str) -> bool {
match resolver.resolve(issuer_did) {
Ok(resolved) => {
let public_key = resolved.public_key();
// use public_key for signature verification
true
}
Err(_) => false,
}
}Required Methods§
Sourcefn resolve(&self, did: &str) -> Result<ResolvedDid, DidResolverError>
fn resolve(&self, did: &str) -> Result<ResolvedDid, DidResolverError>
Resolve a DID to its public key and method.