Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 777 Bytes

key_export.exportSPKI.md

File metadata and controls

37 lines (26 loc) · 777 Bytes

Function: exportSPKI

exportSPKI(key): Promise<string>

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

example Usage

const spkiPem = await exportSPKI(publicKey)

console.log(spkiPem)

example ESM import

import { exportSPKI } from 'jose'

example CJS import

const { exportSPKI } = require('jose')

example Deno import

import { exportSPKI } from 'https://deno.land/x/jose@v4.2.0/index.ts'

Parameters

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

Returns

Promise<string>