Home Reference Source
public class | source

ManualCryptoEngine

Extends:

KeyStoreCryptoEngine → ManualCryptoEngine

Crypto engine that handles hardcoded keys

Static Method Summary

Static Public Methods
public static

async setKeys(memberKeys: Array)

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

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:

NameTypeAttributeDescription
memberKeys Array

keys to set

Must be an array with objects of the format: { publicKey: '123456', privateKey: '123456', level: 'LOW' || 'STANDARD' || 'PRIVILEGED', }

Public Constructors

public constructor(memberId: *) source

Override:

KeyStoreCryptoEngine#constructor

Params:

NameTypeAttributeDescription
memberId *

Public Methods

public async createSigner(level: string): Object source

Create a signer. Assumes we previously generated the relevant key.

Override:

KeyStoreCryptoEngine#createSigner

Params:

NameTypeAttributeDescription
level string

privilege level 'LOW', 'STANDARD', 'PRIVILEGED'

Return:

Object

object that implements sign, signJson

public async createVerifier(keyId: string): Object source

Create a verifier. Assumes we have the key with the passed ID.

Override:

KeyStoreCryptoEngine#createVerifier

Params:

NameTypeAttributeDescription
keyId string

ID of key to use

Return:

Object

object that implements verify, verifyJson

public async generateKey(level: string): Object source

Generate a keyPair and store it.

Override:

KeyStoreCryptoEngine#generateKey

Params:

NameTypeAttributeDescription
level string

privilege level 'LOW', 'STANDARD', 'PRIVILEGED'

Return:

Object

key