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
| Name | Type |
|---|---|
keyType | string |
algorithm | JwsAlgorithm |
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
| Name | Type |
|---|---|
jwk | Jwk |
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
| Name | Type |
|---|---|
keyId | string |
data | Uint8Array |
publicKey | Jwk |
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
| Name | Type |
|---|---|
keyId | string |
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
| Name | Type |
|---|---|
keyId | string |
Returns
Promise\<boolean>