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

x/faster/vendor/jose/key/generate_key_pair.ts>generateKeyPair

A fast and optimized middleware server with an absurdly small amount of code (300 lines) built on top of Deno's native HTTP APIs with no dependencies. It also has a collection of useful middlewares: log file, serve static, CORS, session, rate limit, token, body parsers, redirect, proxy and handle upload. Fully compatible with Deno Deploy.
Latest
function generateKeyPair
import { generateKeyPair } from "https://deno.land/x/faster@v11.7/vendor/jose/key/generate_key_pair.ts";

Generates a private and a public key for a given JWA algorithm identifier. This can only generate asymmetric key pairs. For symmetric secrets use the generateSecret function.

Note: Under Web Crypto API runtime the privateKey is generated with extractable set to false by default. See GenerateKeyPairOptions.extractable to generate an extractable privateKey.

This function is exported (as a named export) from the main 'jose' module entry point as well as from its subpath export 'jose/generate/keypair'.

Type Parameters

optional
KeyLikeType extends KeyLike = KeyLike

Parameters

alg: string

JWA Algorithm Identifier to be used with the generated key pair.

optional
options: GenerateKeyPairOptions

Additional options passed down to the key pair generation.