mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
1008 B
1008 B
Function: exportPKCS8
💗 Help the project
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.
Parameters
| Name | 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)