Skip to main content
Module

x/keygrip/mod.ts>Keygrip

A keygrip implementation in Deno
Latest
class Keygrip
import { Keygrip } from "https://deno.land/x/keygrip@v2.0.0/mod.ts";

Creates a class for storing private keys in a keychain to easily hash and verify data with different keys

Constructors

new
Keygrip(keys: string[], algo?: Algorithm)

Methods

private
compare(a: string, b: string): boolean

Timing safe compare using Brad Hill's Double HMAC pattern

index(data: string, digest: string): number

Resolve the index of which key was used to digest specified data.

sign(data: string, key?: string | number): string

Cryptographically sign data by a secret key

verify(data: string, digest: string): boolean

Verifies if the data matches the digest with any of the keys in the keychain.