toip.tools

API reference · Browser and Node

@toip-tools/trust-core

63 public exports.

TypeScriptModule import
import { type BodyCodec, type BodyContext, BodyError } from "@toip-tools/trust-core";

Functions

  • canonicalJson

    JSON Canonicalization Scheme (RFC 8785) — the byte form eddsa-jcs-2022 and

  • checkStatus
  • decodeBody

    Reads a body of any known format, choosing by its first byte.

  • encodeBody

    The body for `doc`: `codec`'s form when it has one that carries `doc` exactly, otherwise JSON.

  • fromB64u
  • fromUtf8
  • identityFromSeed

    Builds an Ed25519 did:key identity and derives its X25519 encryption keys.

  • isRevokedIn
  • issueCredential

    Creates and signs a VC-shaped credential with a fresh UUID and the issuer's DID.

  • memoryReplayStore

    A store in memory: survives a new guard, not a new process.

  • openItem

    Opens the item as `me`.

  • ourSpec

    A spec in our own namespace.

  • resealText

    New text under the item's existing key, for the same readers.

  • resolveDidKey

    Resolves an Ed25519 did:key locally and derives its X25519 public key without network access.

  • sealItem
  • seedFrom

    Derives a reproducible seed by hashing a label with SHA-256.

  • signDocument

    Signs a JSON object with an eddsa-jcs-2022 Data Integrity proof.

  • toB64u

    base64url without padding, using only APIs present in browsers and Node.

  • utf8
  • verifyCredential

    Checks a credential's proof and validity window.

  • verifyDocument

    Verifies a document's Data Integrity proof, allowing five minutes of clock skew.

Classes

  • BodyError

    Why a body could not be read, in the TSP binding's failure terms.

  • Bus

    An in-memory network that delivers bytes by receiver VID, and lets the UI tap every message.

  • CoarseClock

    A clock that rounds every reading down to `granularityMs` (default one hour), so documents and

  • DemoClock

    A manually advanced clock, so tests are deterministic.

  • Endpoint

    Sends and receives Trust Task documents as real TSP Direct messages.

  • KnowledgeLog
  • PersistentReplayGuard
  • Policies

    Rego policies compiled to one WebAssembly bundle with `opa build -t wasm`, evaluated locally.

  • Refusal

    A handler returns this to refuse a request.

  • RelayTransport
  • StatusList
  • SystemClock
  • TaskError

Interfaces

Types

Constants

Signatures and source documentation are generated from packages/trust-core/src/index.ts.