function multikeyToCrypto
multikeyToCrypto(keys: Multikey): Promise<CryptoKeyPair>

Convert a multikey pair to Web Crypto. This function decodes the multikey data into JWK using the multikeyToJWK function, and imports the resulting keys into Web Crypto.

Works for ecdsa (both P-384 and P-256), and eddsa.

Note that, because WebCrypto methods are asynchronous, so is this function.

Parameters

Return Type

Promise<CryptoKeyPair>

Throws

  • exceptions if something is incorrect in the incoming data
multikeyToCrypto(keys: Multibase): Promise<CryptoKey>

Parameters

Return Type

Promise<CryptoKey>

Usage

import { multikeyToCrypto } from ".";