Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 869 Bytes

key_export.exportPKCS8.md

File metadata and controls

39 lines (27 loc) · 869 Bytes

Function: exportPKCS8

key/export.exportPKCS8

exportPKCS8(key): Promise<string>

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

example ESM import

import { exportPKCS8 } from 'jose/key/export'

example CJS import

const { exportPKCS8 } = require('jose/key/export')

example Deno import

import { exportPKCS8 } from 'https://deno.land/x/jose@v3.20.1/key/export.ts'

example Usage

const pkcs8Pem = await 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>