function sign
sign(
message: string,
userKeys: CryptoSecretKey,
options?: OutputOptions,
): Promise<string>

Sign a message.

The signature can be encoded

  • as plain string, with the value encoded, by default, in base64 or, on request, in base58
  • as a Multibase string, with the value encoded, by default, in base58 or, on request, in base64

Default for Multikeys is multibase with base58; plain string with base64 otherwise.

Parameters

message: string
  • the private/public key pair
optional
options: OutputOptions
  • choice between signature result in multibase or plain, and between base64 or base58 encoding

Return Type

Promise<string>
  • signature in plain or multibase encoded format

Usage

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