DID Document structure and parsing for Exosphere.ATProto.
A DID Document contains:
- The DID itself
- Verification methods (signing keys)
- Service endpoints (PDS location)
- Also known as (handles)
Summary
Functions
Get the handle from a DID Document.
Get the PDS endpoint from a DID Document.
Get the signing key from a DID Document.
Parse a raw DID Document map into a structured Document.
Types
@type t() :: %Exosphere.ATProto.Identity.Document{ also_known_as: [String.t()] | nil, id: String.t(), service: [service()] | nil, verification_method: [verification_method()] | nil }
Functions
Get the handle from a DID Document.
Returns the first at:// URI from alsoKnownAs, extracting just the handle.
Get the PDS endpoint from a DID Document.
Looks for a service with id ending in #atproto_pds and type AtprotoPersonalDataServer.
Get the signing key from a DID Document.
Looks for a verification method with id ending in #atproto.
Returns the public key bytes and curve type.
Parse a raw DID Document map into a structured Document.
Examples
iex> Exosphere.ATProto.Identity.Document.parse(%{"id" => "did:plc:abc", ...})
{:ok, %Document{...}}