Module url

Module url 

Source
Expand description

DID URL parsing and dereferencing.

A DID URL is a DID plus optional path, query, and/or fragment components, per W3C DID Core §3.2:

did-url     = did path-abempty [ "?" query ] [ "#" fragment ]
path-abempty = *( "/" segment )

Examples:

  • did:ndn:BwkI...#key-0 — fragment reference to a verification method
  • did:ndn:BwMg...#key-agreement-1 — zone DID key agreement VM
  • did:ndn:BwkI.../service?type=ndn#endpoint — service lookup

(The method-specific identifier is base64url — no colons.)

§Dereferencing

deref_did_url takes a parsed DID URL and a resolved DidDocument and returns the specific resource the URL identifies — a verification method, a service, or the full document (when no fragment).

Structs§

DidUrl
A parsed DID URL (DID + optional path, query, fragment).

Enums§

DereferencedResource
The resource identified by a dereferenced DID URL.

Functions§

deref_did_url
Dereference a DID URL against an already-resolved DID Document.
deref_did_url_or_document
Convenience: dereference without a fragment, returning the document.