import ManualCryptoEngine from '@token-io/core/src/security/engines/ManualCryptoEngine.js'
ManualCryptoEngine
Extends:
Crypto engine that handles hardcoded keys
Static Method Summary
Static Public Methods | ||
public static |
Set the hardcoded keys used by ManualCryptoEngine |
Constructor Summary
Public Constructor | ||
public |
constructor(memberId: *) |
Method Summary
Public Methods | ||
public |
async createSigner(level: string): Object Create a signer. |
|
public |
async createVerifier(keyId: string): Object Create a verifier. |
|
public |
cryptoForAlgorithm(keyAlgorithm: *): * |
|
public |
async generateKey(level: string): Object Generate a keyPair and store it. |
Inherited Summary
From class KeyStoreCryptoEngine | ||
public static |
|
|
private |
|
|
private |
|
|
private |
|
|
public |
async createSigner(level: KeyLevel): Object Creates a signer. |
|
public |
async createVerifier(keyId: string): Object Creates a verifier. |
|
public |
async generateKey(level: KeyLevel, expirationMs: number | string): Object Generates a key pair and store it. |
Static Public Methods
public static async setKeys(memberKeys: Array) source
Set the hardcoded keys used by ManualCryptoEngine
Params:
Name | Type | Attribute | Description |
memberKeys | Array | keys to set Must be an array with objects of the format: { id: '123456', // optional publicKey: '123456', privateKey: '123456', level: 'LOW' || 'STANDARD' || 'PRIVILEGED', algorithm: 'ED25519' || 'RSA', // optional (default to 'ED25519') } |
Public Constructors
public constructor(memberId: *) source
Override:
KeyStoreCryptoEngine#constructorParams:
Name | Type | Attribute | Description |
memberId | * |
Public Methods
public async createSigner(level: string): Object source
Create a signer. Assumes we previously generated the relevant key.
Override:
KeyStoreCryptoEngine#createSignerParams:
Name | Type | Attribute | Description |
level | string | privilege level 'LOW', 'STANDARD', 'PRIVILEGED' |
public async createVerifier(keyId: string): Object source
Create a verifier. Assumes we have the key with the passed ID.
Override:
KeyStoreCryptoEngine#createVerifierParams:
Name | Type | Attribute | Description |
keyId | string | ID of key to use |
public cryptoForAlgorithm(keyAlgorithm: *): * source
Params:
Name | Type | Attribute | Description |
keyAlgorithm | * |
Return:
* |