Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/jose/key/export.ts>exportSPKI

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno.
Extremely Popular
Go to Latest
function exportSPKI
import { exportSPKI } from "https://deno.land/x/jose@v3.20.4/key/export.ts";

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

Examples

ESM import

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

CJS import

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

Deno import

import { exportSPKI } from 'https://deno.land/x/jose@VERSION/key/export.ts'

Usage

const spkiPem = await exportSPKI(publicKey)

console.log(spkiPem)

Parameters

key: KeyLike

Key representation to transform to an PEM-encoded SPKI string format.

Returns

Promise<string>