Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jose/types.d.ts>KeyLike

JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Latest
type alias KeyLike
import { type KeyLike } from "https://deno.land/x/jose@v5.9.6/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 | 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 key/import | Key Import Functions you may use the runtime APIs !createPublicKey, !createPrivateKey, and !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 key/import | Key Import Functions you may use the !SubtleCrypto.importKey API to obtain a !CryptoKey from your existing key material.

definition: { type: string; }