mirror of
https://github.com/danbulant/jose
synced 2026-05-19 04:18:52 +00:00
856 B
856 B
Function: exportSPKI
key/export.exportSPKI
▸ exportSPKI(key): Promise<string>
Exports a runtime-specific public key representation (KeyObject or CryptoKey) to an PEM-encoded SPKI string format.
example ESM import
import { exportSPKI } from 'jose/key/export'
example CJS import
const { exportSPKI } = require('jose/key/export')
example Deno import
import { exportSPKI } from 'https://deno.land/x/jose@v3.20.0/key/export.ts'
example Usage
const spkiPem = await exportSPKI(publicKey)
console.log(spkiPem)
Parameters
| Name | Type | Description |
|---|---|---|
key |
KeyLike |
Key representation to transform to an PEM-encoded SPKI string format. |
Returns
Promise<string>