mirror of
https://github.com/danbulant/jose
synced 2026-05-22 13:58:47 +00:00
777 B
777 B
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.0.1/index.ts'
Parameters
| Name | Type | Description |
|---|---|---|
key |
KeyLike |
Key representation to transform to an PEM-encoded SPKI string format. |
Returns
Promise<string>