Did

class Did(val uri: String, val url: String, val method: String, val id: String, val params: Map<String, String> = emptyMap(), val path: String? = null, val query: String? = null, val fragment: String? = null)

DID provides a way to parse and handle Decentralized Identifier (DID) URIs according to the W3C DID Core specification (https://www.w3.org/TR/did-core/).

Constructors

Link copied to clipboard
constructor(uri: String, url: String, method: String, id: String, params: Map<String, String> = emptyMap(), path: String? = null, query: String? = null, fragment: String? = null)

Types

Link copied to clipboard
object Parser

Parser object used to Parse a DID URI into a DID object.

Properties

Link copied to clipboard
val fragment: String? = null

is an optional fragment component in the DID URI, used to reference a specific part of a DID document. Spec: https://www.w3.org/TR/did-core/#fragment

Link copied to clipboard
val id: String

is the method-specific identifier in the DID URI. Spec: https://www.w3.org/TR/did-core/#method-specific-id

Link copied to clipboard

specifies the DID method in the URI, which indicates the underlying method-specific identifier scheme (e.g., jwk, dht, key, etc.). Spec: https://www.w3.org/TR/did-core/#method-schemes

Link copied to clipboard

is a map containing optional parameters present in the DID URI. These parameters are method-specific. Spec: https://www.w3.org/TR/did-core/#did-parameters

Link copied to clipboard
val path: String? = null

is an optional path component in the DID URI. Spec: https://www.w3.org/TR/did-core/#path

Link copied to clipboard
val query: String? = null

is an optional query component in the DID URI, used to express a request for a specific representation or resource related to the DID. Spec: https://www.w3.org/TR/did-core/#query

Link copied to clipboard
val uri: String

represents the complete Decentralized Identifier (DID) URI. Spec: https://www.w3.org/TR/did-core/#did-syntax

Link copied to clipboard
val url: String

represents the DID URI + A network location identifier for a specific resource Spec: https://www.w3.org/TR/did-core/#did-url-syntax

Functions

Link copied to clipboard

Marshal text into byteArray.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unmarshalText(byteArray: ByteArray): Did

Unmarshal byteArray into a DID.