Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1.11 KB

key_export.exportSPKI.md

File metadata and controls

33 lines (20 loc) · 1.11 KB

Function: exportSPKI

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.


exportSPKI(key): Promise<string>

Exports a runtime-specific public key representation (KeyObject or CryptoKey) to a PEM-encoded SPKI string format.

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 KeyLike Key representation to transform to a PEM-encoded SPKI string format.

Returns

Promise<string>

Example

const spkiPem = await jose.exportSPKI(publicKey)

console.log(spkiPem)