Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 833 Bytes

key_export.exportJWK.md

File metadata and controls

39 lines (28 loc) · 833 Bytes

Function: exportJWK

exportJWK(key): Promise<JWK>

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

example Usage

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

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

example ESM import

import { exportJWK } from 'jose'

example CJS import

const { exportJWK } = require('jose')

example Deno import

import { exportJWK } from 'https://deno.land/x/jose@v4.1.4/index.ts'

Parameters

Name Type Description
key KeyLike | Uint8Array Key representation to export as JWK.

Returns

Promise<JWK>