Skip to main content
Version: 1.3

Class: Disclosure

identity_wasm.Disclosure

Represents an elements constructing a disclosure. Object properties and array elements disclosures are supported.

See: https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-07.html#name-disclosures

Table of contents

Constructors

Methods

Constructors

constructor

new Disclosure(salt, claim_name, claim_value)

Parameters

NameType
saltstring
claim_nameundefined | string
claim_valueany

Methods

toJSON

toJSON(): Object

  • Return copy of self without private attributes.

Returns

Object

toJSON(): any

Serializes this to a JSON object.

Returns

any


toString

toString(): string

Return stringified version of self.

Returns

string

toString(): string

Returns a copy of the base64url-encoded string.

Returns

string


parse

Static parse(disclosure): Disclosure

Parses a Base64 encoded disclosure into a Disclosure.

Error

Returns an InvalidDisclosure if input is not a valid disclosure.

Parameters

NameType
disclosurestring

Returns

Disclosure


disclosure

disclosure(): string

Returns a copy of the base64url-encoded string.

Returns

string


toEncodedString

toEncodedString(): string

Returns a copy of the base64url-encoded string.

Returns

string


salt

salt(): string

Returns a copy of the salt value.

Returns

string


claimName

claimName(): undefined | string

Returns a copy of the claim name, optional for array elements.

Returns

undefined | string


claimValue

claimValue(): any

Returns a copy of the claim Value which can be of any type.

Returns

any


fromJSON

Static fromJSON(json): Disclosure

Deserializes an instance from a JSON object.

Parameters

NameType
jsonany

Returns

Disclosure