Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.26 KB

key_export.exportJWK.md

File metadata and controls

34 lines (21 loc) · 1.26 KB

Function: exportJWK

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


exportJWK(key): Promise<JWK>

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

This function is exported (as a named export) from the main 'jose' module entry point as well as from its subpath export 'jose/key/export'.

Parameters

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

Returns

Promise<JWK>

Example

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

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