Skip to main content

SdObjectDecoder

@iota/identity-wasm API documentation


Class: SdObjectDecoder

Substitutes digests in an SD-JWT object by their corresponding plaintext values provided by disclosures.

Constructors​

new SdObjectDecoder()​

new SdObjectDecoder(): SdObjectDecoder

Creates a new SdObjectDecoder with sha-256 hasher.

Returns​

SdObjectDecoder

Methods​

toJSON()​

toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object


toString()​

toString(): string

Return stringified version of self.

Returns​

string


decode()​

decode(object, disclosures): Record<string, any>

Decodes an SD-JWT object containing by Substituting the digests with their corresponding plaintext values provided by disclosures.

Notes​

  • Claims like exp or iat are not validated in the process of decoding.
  • _sd_alg property will be removed if present.

Parameters​

object​

Record<string, any>

disclosures​

string[]

Returns​

Record<string, any>