mirror of
https://github.com/danbulant/jose
synced 2026-05-20 12:58:36 +00:00
861 B
861 B
Function: exportJWK
▸ exportJWK(key): Promise<JWK>
Exports a runtime-specific key representation (KeyLike) to a JWK.
example ESM import
import { exportJWK } from 'jose/key/export'
example CJS import
const { exportJWK } = require('jose/key/export')
example Deno import
import { exportJWK } from 'https://deno.land/x/jose@v3.20.3/key/export.ts'
example Usage
const privateJwk = await exportJWK(privateKey)
const publicJwk = await exportJWK(publicKey)
console.log(privateJwk)
console.log(publicJwk)
Parameters
| Name | Type | Description |
|---|---|---|
key |
KeyLike | Uint8Array |
Key representation to export as JWK. |
Returns
Promise<JWK>