import { generateKeyPair } from "https://deno.land/x/jose@v4.11.2/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 Cryptography API runtime the privateKey
is generated with extractable
set to
false
by default.
Examples
Usage
Usage
const { publicKey, privateKey } = await jose.generateKeyPair('PS256')
console.log(publicKey)
console.log(privateKey)
Parameters
optional
options: GenerateKeyPairOptionsAdditional options passed down to the key pair generation.
Returns
Promise<GenerateKeyPairResult>