Skip to main content
Module

x/acorn/deps.ts>KeyRing

A focused RESTful server framework for Deno 🌰🦕
Go to Latest
interface KeyRing
import { type KeyRing } from "https://deno.land/x/acorn@0.0.5/deps.ts";

An abstract interface for a keyring which handles signing of data based on a string based digest.

Methods

indexOf(data: Data, digest: string): Promise<number> | number

Given a set of data and a digest, return the key index of the key used to sign the data. The index is 0 based. A non-negative number indices the digest is valid and a key was found.

sign(data: Data): Promise<string> | string

Sign the data, returning a string based digest of the data.

verify(data: Data, digest: string): Promise<boolean> | boolean

Verifies the digest matches the provided data, indicating the data was signed by the keyring and has not been tampered with.