Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/jose/key/export.ts>exportJWK

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno.
Extremely Popular
Go to Latest
function exportJWK
import { exportJWK } from "https://deno.land/x/jose@v3.20.4/key/export.ts";

Exports a runtime-specific key representation (KeyLike) to a JWK.

Examples

ESM import

import { exportJWK } from 'jose/key/export'

CJS import

const { exportJWK } = require('jose/key/export')

Deno import

import { exportJWK } from 'https://deno.land/x/jose@VERSION/key/export.ts'

Usage

const privateJwk = await exportJWK(privateKey)
const publicJwk = await exportJWK(publicKey)

console.log(privateJwk)
console.log(publicJwk)

Parameters

key: KeyLike | Uint8Array

Key representation to export as JWK.

Returns

Promise<JWK>