Skip to main content
info
IOTA Identity for Rebased is currently in alpha and may still be subject to significant changes

JwkStorage

@iota/identity-wasm API documentation


Interface: JwkStorage

Secure storage for cryptographic keys represented as JWKs.

Properties

generate()

generate: (keyType, algorithm) => Promise<JwkGenOutput>

Generate a new key represented as a JSON Web Key.

It's recommend that the implementer exposes constants for the supported key type string.

Parameters

keyType

string

algorithm

JwsAlgorithm

Returns

Promise<JwkGenOutput>


insert()

insert: (jwk) => Promise<string>

Insert an existing JSON Web Key into the storage.

All private key components of the jwk must be set.

Parameters

jwk

Jwk

Returns

Promise<string>


sign()

sign: (keyId, data, publicKey) => Promise<Uint8Array>

Sign the provided data using the private key identified by keyId according to the requirements of the given public_key corresponding to keyId.

Parameters

keyId

string

data

Uint8Array

publicKey

Jwk

Returns

Promise<Uint8Array>


delete()

delete: (keyId) => Promise<void>

Deletes the key identified by keyId.

Warning

This operation cannot be undone. The keys are purged permanently.

Parameters

keyId

string

Returns

Promise<void>


exists()

exists: (keyId) => Promise<boolean>

Returns true if the key with the given keyId exists in storage, false otherwise.

Parameters

keyId

string

Returns

Promise<boolean>