function decrypt
decrypt(
ciphertext: string,
userKey: CryptoSecretKey,
options?: OutputOptions,
): Promise<string>

Decrypt a ciphertext.

The option should be identical to the value used (if any) for signature, except that, if the signature option refers to multibase, the values of encoding is ignored (and is deduced from the multibase itself).

Parameters

ciphertext: string
optional
options: OutputOptions
  • choice between signature result in multibase or plain, and between base64 or base58 encoding.

Return Type

Promise<string>

Usage

import { decrypt } from "lib/crypto.ts";