Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface KeyRing
Deprecated
Deprecated

(will be removed in 0.212.0) Use https://deno.land/std/http/unstable_signed_cookie.ts instead.

import { type KeyRing } from "https://deno.land/std@0.209.0/http/unstable_cookie_map.ts";

An interface which describes the methods that SecureCookieMap uses to sign and verify cookies.

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.