jose/docs/functions/key_export.exportJWK.md
2021-11-10 15:20:12 +01:00

594 B

Function: exportJWK

exportJWK(key): Promise<JWK>

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

example Usage

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

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

Parameters

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

Returns

Promise<JWK>