toip.tools

interface · Browser and Node

Signer

@toip-tools/eventlogView source
TypeScriptImport
import { type Signer } from "@toip-tools/eventlog";

Declaration

TypeScriptinterface
interface Signer {
  /** Defaults to Ed25519 when absent. */
  readonly curve?: Curve;
  /** 32 bytes for Ed25519; 33 bytes (compressed point) for P-256. */
  readonly publicKey: Uint8Array;
  sign(message: Uint8Array): Promise<Uint8Array | WrappedSignature>;
}

Properties

curveoptional · readonly
Curve | undefined

Defaults to Ed25519 when absent.

publicKeyrequired · readonly
Uint8Array<ArrayBufferLike>

32 bytes for Ed25519; 33 bytes (compressed point) for P-256.

Methods

sign

TypeScriptSignature
sign(message: Uint8Array): Promise<Uint8Array | WrappedSignature>;

Parameters

messagerequired
Uint8Array<ArrayBufferLike>

Returns

Promise<Uint8Array<ArrayBufferLike> | WrappedSignature>