DidService

@Serializable
data class DidService(val id: String, val type: List<String>, val serviceEndpoint: ServiceEndpoint)

Represents a service endpoint in a DID Document.

Following W3C DID Core specification, services provide means of communication or interaction with the DID subject. Per DID 1.1 / CID, type may be a string or a set of strings; we model it as a non-empty list.

Parameters

id

The service identifier (can be relative or absolute URI)

type

Service type(s) (e.g. "LinkedDomains", "DIDCommMessaging"); at least one required

serviceEndpoint

The service endpoint (can be a URL, object, or array)

Constructors

Link copied to clipboard
constructor(id: String, type: List<String>, serviceEndpoint: ServiceEndpoint)

Properties

Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Gets the service endpoint as an array, if it's an array.

Link copied to clipboard

Gets the service endpoint as an object (map), if it's an object.

Link copied to clipboard

Gets the service endpoint as a URL string, if it's a simple URL.

Link copied to clipboard

Returns the typed ServiceEndpoint for this service.