DidDocument

class DidDocument(val id: String, val context: List<String>? = null, val alsoKnownAs: List<String>? = null, val controller: List<String>? = null, val verificationMethod: List<VerificationMethod>? = null, val service: List<Service>? = null, val assertionMethod: List<String>? = null, val authentication: List<String>? = null, val keyAgreement: List<String>? = null, val capabilityDelegation: List<String>? = null, val capabilityInvocation: List<String>? = null)

DidDocument represents a set of data describing the DID subject including mechanisms such as:

  • cryptographic public keys - used to authenticate itself and prove association with the DID

  • services - means of communicating or interacting with the DID subject or associated entities via one or more service endpoints. Examples include discovery services, agent services, social networking services, file storage services, and verifiable credential repository services. A DID Document can be retrieved by resolving a DID URI. DID Core spec: https://www.w3.org/TR/did-core/#core-properties

Constructors

Link copied to clipboard
constructor(id: String, context: List<String>? = null, alsoKnownAs: List<String>? = null, controller: List<String>? = null, verificationMethod: List<VerificationMethod>? = null, service: List<Service>? = null, assertionMethod: List<String>? = null, authentication: List<String>? = null, keyAgreement: List<String>? = null, capabilityDelegation: List<String>? = null, capabilityInvocation: List<String>? = null)

Types

Link copied to clipboard
class Builder

Builder object to build a DidDocument.

Properties

Link copied to clipboard
val alsoKnownAs: List<String>? = null

AlsoKnownAs can contain multiple identifiers for different purposes, or at different times for the same DID subject. The assertion that two or more DIDs (or other types of URI) refer to the same DID subject can be made using the alsoKnownAs property.

Link copied to clipboard

used to specify how the DID subject is expected to express claims, such as for the purposes of issuing a Verifiable Credential.

Link copied to clipboard
val authentication: List<String>? = null

specifies how the DID subject is expected to be authenticated, for purposes such as logging into a website or engaging in any sort of challenge-response protocol.

Link copied to clipboard

specifies a mechanism used by the DID subject to delegate a cryptographic capability to another party, such as delegating the authority to access a specific HTTP API.

Link copied to clipboard

specifies a verification method used by the DID subject to invoke a cryptographic capability, such as the authorization to update the DID Document.

Link copied to clipboard
val context: List<String>? = null

a list of URI that defines the schema version used in the document.

Link copied to clipboard
val controller: List<String>? = null

defines an entity that is authorized to make changes to a DID document. The process of authorizing a DID controller is defined by the DID method. It can be a string or a list of strings.

Link copied to clipboard
val id: String

the DID URI for a particular DID subject, expressed using the id property in the DID document.

Link copied to clipboard
val keyAgreement: List<String>? = null

specifies how an entity can generate encryption material to transmit confidential information intended for the DID subject, such as for establishing a secure communication channel.

Link copied to clipboard
val service: List<Service>? = null

expresses ways of communicating with the DID subject or associated entities. A service can be any type of service the DID subject wants to advertise.

Link copied to clipboard

a list of cryptographic public keys, which can be used to authenticate or authorize interactions with the DID subject or associated parties.

Functions

Link copied to clipboard
fun findAssertionMethodById(assertionMethodId: String? = null): VerificationMethod

Finds the first available assertion method from the DidDocument. When assertionMethodId is null, the function will return the first available assertion method.

Link copied to clipboard

GetAbsoluteResourceID returns a fully qualified ID for a document resource (e.g. service, verification method) Document Resource IDs are allowed to be relative DID URLs as a means to reduce storage size of DID Documents. More info here: https://www.w3.org/TR/did-core/#relative-did-urls

Link copied to clipboard

Select verification method takes a selector that can be used to select a specific verification method from the DID Document. If a selector is not provided, the first verification method is returned

Link copied to clipboard
open override fun toString(): String