DidDocument

@Serializable
data class DidDocument(val id: Did, val context: List<String> = listOf("https://www.w3.org/ns/did/v1"), val alsoKnownAs: List<DidOrUrl> = emptyList(), val controller: List<Did> = emptyList(), val verificationMethod: List<VerificationMethod> = emptyList(), val authentication: List<VerificationMethodId> = emptyList(), val assertionMethod: List<VerificationMethodId> = emptyList(), val keyAgreement: List<VerificationMethodId> = emptyList(), val capabilityInvocation: List<VerificationMethodId> = emptyList(), val capabilityDelegation: List<VerificationMethodId> = emptyList(), val service: List<DidService> = emptyList())

Represents a DID Document following W3C DID Core structure.

Parameters

id

The DID identifier (typed)

context

JSON-LD context(s) for the document (defaults to W3C DID Core context)

alsoKnownAs

Alternative identifiers (DID or absolute URL per spec); see DidOrUrl

controller

DIDs that control this DID (typed)

verificationMethod

List of verification methods

authentication

List of verification method references for authentication (typed)

assertionMethod

List of verification method references for assertions (typed)

keyAgreement

List of verification method references for key agreement (typed)

capabilityInvocation

List of verification method references for capability invocation (typed)

capabilityDelegation

List of verification method references for capability delegation (typed)

service

List of service endpoints

Constructors

Link copied to clipboard
constructor(id: Did, context: List<String> = listOf("https://www.w3.org/ns/did/v1"), alsoKnownAs: List<DidOrUrl> = emptyList(), controller: List<Did> = emptyList(), verificationMethod: List<VerificationMethod> = emptyList(), authentication: List<VerificationMethodId> = emptyList(), assertionMethod: List<VerificationMethodId> = emptyList(), keyAgreement: List<VerificationMethodId> = emptyList(), capabilityInvocation: List<VerificationMethodId> = emptyList(), capabilityDelegation: List<VerificationMethodId> = emptyList(), service: List<DidService> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: Did
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Expands relative DID URLs in this document to absolute DID URLs, per the expandRelativeUrls resolution option (DID Resolution 1.0 §4.1, §4.4).

Link copied to clipboard

Re-expresses a document that was produced for from as a document for to, consistently.