DidDocumentJsonParser

Shared conforming consumer for DID document JSON per DID 1.1 §6.2.2.

Used by org.trustweave.did.resolver.DefaultUniversalResolver and org.trustweave.did.registrar.adapter.StandardUniversalRegistrarAdapter so that parsing behavior is consistent and supports:

  • controller (string or array)

  • alsoKnownAs (array of URL or DID)

  • Relationship arrays (authentication, assertionMethod, etc.) with string refs or embedded VM objects. Embedded VMs are normalized per strategy (B): merged into verificationMethod (dedupe by id), relationships stored as VerificationMethodId only.

  • Relative refs (e.g. "#key-1") resolved against document id.

Throws

when required fields are missing or invalid

Functions

Link copied to clipboard
fun parse(json: JsonObject): DidDocument

Parses a DID document from a JSON object.