File: key_export.exportSPKI.md

package info (click to toggle)
node-jose 4.11.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 4,264 kB
  • sloc: javascript: 16,258; sh: 111; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Function: exportSPKI

[💗 Help the project](https://github.com/sponsors/panva)

â–¸ **exportSPKI**(`key`): `Promise`<`string`\>

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

**`example`** Usage

```js
const spkiPem = await jose.exportSPKI(publicKey)

console.log(spkiPem)
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `key` | [`KeyLike`](../types/types.KeyLike.md) | Key representation to transform to a PEM-encoded SPKI string format. |

#### Returns

`Promise`<`string`\>