▸ 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'
Name | Type | Description |
---|---|---|
key |
KeyLike |
Key representation to transform to an PEM-encoded SPKI string format. |
Promise
<string
>