Skip to main content
Version: 1.3

Class: SdObjectDecoder

identity_wasm.SdObjectDecoder

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

Table of contents

Constructors

Methods

Constructors

constructor

new SdObjectDecoder()

Creates a new SdObjectDecoder with sha-256 hasher.

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

NameType
objectRecord\<string, any>
disclosuresstring[]

Returns

Record\<string, any>