function generateKeysMK
generateKeysMK(
algorithm: CryptoAlgorithm,
options?: KeyOptions,
): Promise<Multikey>

Generate a new public/private key pair in one of the ecdsa or eddsa crypto algorithms (the term Ed25519 can also be used for eddsa). The result is a pair or Multibase formatted keys, i.e., in Multikey.

Ecdsa can be (optionally) parametrized through the key options: the nameCurve field can be set to "P-256" or "P-384" to change the EC curve. Default is "P-256"

Parameters

  • can be ecdsa, eddsa, Ed25519
optional
options: KeyOptions
  • depends on the algorithm chosen

Return Type

Promise<Multikey>

Usage

import { generateKeysMK } from ".";