Skip to main content
Version: 1.4

Class: Jwk

identity_wasm.Jwk

Table of contents

Constructors

Methods

Constructors

constructor

new Jwk(jwk)

Parameters

NameType
jwkIJwkParams

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


kty

kty(): JwkType

Returns the value for the key type parameter (kty).

Returns

JwkType


use

use(): undefined | JwkUse

Returns the value for the use property (use).

Returns

undefined | JwkUse


keyOps

keyOps(): JwkOperation[]

Returns

JwkOperation[]


alg

alg(): undefined | JwsAlgorithm

Returns the value for the algorithm property (alg).

Returns

undefined | JwsAlgorithm


kid

kid(): undefined | string

Returns the value of the key ID property (kid).

Returns

undefined | string


x5u

x5u(): undefined | string

Returns the value of the X.509 URL property (x5u).

Returns

undefined | string


x5c

x5c(): string[]

Returns the value of the X.509 certificate chain property (x5c).

Returns

string[]


x5t

x5t(): undefined | string

Returns the value of the X.509 certificate SHA-1 thumbprint property (x5t).

Returns

undefined | string


x5t256

x5t256(): undefined | string

Returns the value of the X.509 certificate SHA-256 thumbprint property (x5t#S256).

Returns

undefined | string


paramsEc

paramsEc(): undefined | JwkParamsEc

If this JWK is of kty EC, returns those parameters.

Returns

undefined | JwkParamsEc


paramsOkp

paramsOkp(): undefined | JwkParamsOkp

If this JWK is of kty OKP, returns those parameters.

Returns

undefined | JwkParamsOkp


paramsOct

paramsOct(): undefined | JwkParamsOct

If this JWK is of kty OCT, returns those parameters.

Returns

undefined | JwkParamsOct


paramsRsa

paramsRsa(): undefined | JwkParamsRsa

If this JWK is of kty RSA, returns those parameters.

Returns

undefined | JwkParamsRsa


toPublic

toPublic(): undefined | Jwk

Returns a clone of the Jwk with all private key components unset. Nothing is returned when kty = oct as this key type is not considered public by this library.

Returns

undefined | Jwk


isPublic

isPublic(): boolean

Returns true if all private key components of the key are unset, false otherwise.

Returns

boolean


isPrivate

isPrivate(): boolean

Returns true if all private key components of the key are set, false otherwise.

Returns

boolean


fromJSON

Static fromJSON(json): Jwk

Deserializes an instance from a JSON object.

Parameters

NameType
jsonany

Returns

Jwk


clone

clone(): Jwk

Deep clones the object.

Returns

Jwk