Expand description
A collection of methods for DID resolution and related utilities.
This module provides functionality for resolving Decentralized Identifiers (DIDs)
using different DID methods including did:key, did:web, and did:peer.
§Examples
§Basic did:key resolution example.
use did_utils::methods::{DIDResolver, DidKey};
use did_utils::methods::DIDResolutionOptions;
let did_key_resolver = DidKey::new();
let did = "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK";
let output = did_key_resolver.resolve(did, &DIDResolutionOptions::default()).await;§An example demonstrating a basic usage of did:web
use did_utils::methods::{DIDResolver, DidWeb};
use did_utils::methods::DIDResolutionOptions;
let port = 3000;
let host = "localhost";
let formatted_string = format!("did:web:{}%3A{}", host.to_string(), port);
let did: &str = &formatted_string;
let did_web_resolver = DidWeb::new();
let output = did_web_resolver.resolve(
did,
&DIDResolutionOptions::default()
).await;§An example demonstrating a basic usage of did:peer
use did_utils::methods::{DIDResolver, DidPeer};
use did_utils::methods::DIDResolutionOptions;
let did = "did:peer:0z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK";
let did_peer_resolver = DidPeer::new();
let output = did_peer_resolver.resolve(
did,
&DIDResolutionOptions::default()
).await;Structs§
- DIDDocument
Metadata - DID Document Metadata.
- DIDResolution
Metadata - DID Resolution Metadata.
- DIDResolution
Options - DID Resolution Options.
- Dereferencing
Output - Dereferencing Output.
- DidKey
- DidPeer
- DidWeb
- A struct for resolving DID Web documents.
- Purposed
Key - Resolution
Output - DID Resolution Output.
Enums§
- Content
- A resource returned by DID URL dereferencing
- DIDResolution
Error - Registry for error types found across the DID core specification, and especially during the DID resolution process.
- DidWeb
Error - Media
Type - Media type for resolution input and output metadata.
- Parsing
Error Source - Purpose
Traits§
- DIDMethod
- Abstract contract for DID methods.
- DIDResolver
- Abstract contract for DID resolution.
Type Aliases§
- Content
Metadata - Content Metadata.
- Dereferencing
Metadata - DID URL Dereferencing Metadata.
- Dereferencing
Options - DID URL Dereferencing Options.