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

539 B

Function: exportPKCS8

exportPKCS8(key): Promise<string>

Exports a runtime-specific private key representation (KeyObject or CryptoKey) to an PEM-encoded PKCS8 string format.

example Usage

const pkcs8Pem = await jose.exportPKCS8(privateKey)

console.log(pkcs8Pem)

Parameters

Name Type Description
key KeyLike Key representation to transform to an PEM-encoded PKCS8 string format.

Returns

Promise<string>