Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.22 KB

exportPKCS8.md

File metadata and controls

31 lines (19 loc) · 1.22 KB

Function: exportPKCS8()

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.

exportPKCS8(key): Promise<string>

Exports a runtime-specific private key representation (KeyObject or CryptoKey) to a PEM-encoded PKCS8 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

Parameter Type Description
key KeyLike Key representation to transform to a PEM-encoded PKCS8 string format.

Returns

Promise<string>

Example

const pkcs8Pem = await jose.exportPKCS8(privateKey)

console.log(pkcs8Pem)