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
| Name | Type |
|---|---|
did | IToCoreDID | 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
| Name | Type |
|---|---|
input | string |
Returns
jwk
▸ jwk(): Jwk
Returns the JSON WEB KEY (JWK) encoded inside this did:jwk.
Returns
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
| Name | Type |
|---|---|
json | any |
Returns
clone
▸ clone(): DIDJwk
Deep clones the object.