Skip to main content
Version: 1.4

Class: DIDJwk

identity_wasm.DIDJwk

did:jwk DID.

Table of contents

Constructors

Methods

Constructors

constructor

new DIDJwk(did)

Creates a new DIDJwk from a CoreDID.

Errors

Throws an error if the given did is not a valid did:jwk DID.

Parameters

NameType
didIToCoreDID | CoreDID

Methods

parse

Static parse(input): DIDJwk

Parses a DIDJwk from the given input.

Errors

Throws an error if the input is not a valid DIDJwk.

Parameters

NameType
inputstring

Returns

DIDJwk


jwk

jwk(): Jwk

Returns the JSON WEB KEY (JWK) encoded inside this did:jwk.

Returns

Jwk


scheme

scheme(): string

Returns the CoreDID scheme.

E.g.

  • "did:example:12345678" -> "did"
  • "did:iota:smr:12345678" -> "did"

Returns

string


authority

authority(): string

Returns the CoreDID authority: the method name and method-id.

E.g.

  • "did:example:12345678" -> "example:12345678"
  • "did:iota:smr:12345678" -> "iota:smr:12345678"

Returns

string


method

method(): string

Returns the CoreDID method name.

E.g.

  • "did:example:12345678" -> "example"
  • "did:iota:smr:12345678" -> "iota"

Returns

string


methodId

methodId(): string

Returns the CoreDID method-specific ID.

E.g.

  • "did:example:12345678" -> "12345678"
  • "did:iota:smr:12345678" -> "smr:12345678"

Returns

string


toString

toString(): string

Returns the CoreDID as a string.

Returns

string


toJSON

toJSON(): any

Serializes this to a JSON object.

Returns

any


fromJSON

Static fromJSON(json): DIDJwk

Deserializes an instance from a JSON object.

Parameters

NameType
jsonany

Returns

DIDJwk


clone

clone(): DIDJwk

Deep clones the object.

Returns

DIDJwk