Skip to content
Get startedGetting started →

Ed25519SigningSession

A live signing session holding an Ed25519 private key. createEd25519SigningSession returns it.

import type { Ed25519SigningSession } from "@category-labs/mera";

Uint8Array, the 32-byte Ed25519 public key.

Signs an arbitrary-length message and resolves to the 64-byte Ed25519 signature (R || s). Hashing happens inside Ed25519 itself.

Zeroes the session-owned private-key copy and permanently ends the session; later signing throws SESSION_ENDED.

Calls end, so a using declaration ends the session when its scope exits:

import { createEd25519SigningSession } from "@category-labs/mera";
const privateKey = crypto.getRandomValues(new Uint8Array(32));
const message = new TextEncoder().encode("hello mera");
{
using session = createEd25519SigningSession({ privateKey });
await session.signMessage(message);
} // ended here