Class: generate

(async) Key.generate(type, param)

(async) new generate(type, param)

Securely generates a new key of the given type and paramter.

Supported key types

Eliptic curve keys:

  • type must be 'EC'
  • param must be supported curve type, from: secp256k1

Octet byte sequence:

  • type must be 'oct'
  • param must be supported bit length, from: 128, 256 or 512
Parameters:
Name Type Description
type String
param String | Number
Source: