Skip to main content
Module

x/jose/types.d.ts>KeyLike

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
type alias KeyLike
import { type KeyLike } from "https://deno.land/x/jose@v4.14.4/types.d.ts";

KeyLike are runtime-specific classes representing asymmetric keys or symmetric secrets. These are instances of CryptoKey and additionally KeyObject in Node.js runtime. Uint8Array instances are also accepted as symmetric secret representation only.

Key Import Functions can be used to import PEM, or JWK formatted asymmetric keys and certificates to these runtime-specific representations.

In Node.js the Buffer class is a subclass of Uint8Array and so Buffer can be provided for symmetric secrets as well.

KeyObject is a representation of a key/secret available in the Node.js runtime. In addition to the import functions of this library you may use the runtime APIs crypto.createPublicKey, crypto.createPrivateKey, and crypto.createSecretKey to obtain a KeyObject from your existing key material.

CryptoKey is a representation of a key/secret available in the Browser and Web-interoperable runtimes. In addition to the import functions of this library you may use the SubtleCrypto.importKey API to obtain a CryptoKey from your existing key material.

definition: { type: string; }