Skip to main content
Version: 1.3

Interface: JwkStorage

identity_wasm.JwkStorage

Secure storage for cryptographic keys represented as JWKs.

Table of contents

Properties

Properties

generate

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

Type declaration

▸ (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
NameType
keyTypestring
algorithmJwsAlgorithm
Returns

Promise\<JwkGenOutput>


insert

insert: (jwk: Jwk) => Promise\<string>

Type declaration

▸ (jwk): Promise\<string>

Insert an existing JSON Web Key into the storage.

All private key components of the jwk must be set.

Parameters
NameType
jwkJwk
Returns

Promise\<string>


sign

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

Type declaration

▸ (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
NameType
keyIdstring
dataUint8Array
publicKeyJwk
Returns

Promise\<Uint8Array>


delete

delete: (keyId: string) => Promise\<void>

Type declaration

▸ (keyId): Promise\<void>

Deletes the key identified by keyId.

Warning

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

Parameters
NameType
keyIdstring
Returns

Promise\<void>


exists

exists: (keyId: string) => Promise\<boolean>

Type declaration

▸ (keyId): Promise\<boolean>

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

Parameters
NameType
keyIdstring
Returns

Promise\<boolean>