File: types.GetKeyFunction.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 (32 lines) | stat: -rw-r--r-- 914 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
27
28
29
30
31
32
# Interface: GetKeyFunction<T, T2\>

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

## Type parameters

| Name |
| :------ |
| `T` |
| `T2` |

## Callable

### GetKeyFunction

â–¸ **GetKeyFunction**(`protectedHeader`, `token`): `Uint8Array` \| [`KeyLike`](../types/types.KeyLike.md) \| `Promise`<`Uint8Array` \| [`KeyLike`](../types/types.KeyLike.md)\>

Generic Interface for consuming operations dynamic key resolution. No token components have been
verified at the time of this function call.

If you cannot match a key suitable for the token, throw an error instead.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `protectedHeader` | `T` | JWE or JWS Protected Header. |
| `token` | `T2` | The consumed JWE or JWS token. |

#### Returns

`Uint8Array` \| [`KeyLike`](../types/types.KeyLike.md) \| `Promise`<`Uint8Array` \| [`KeyLike`](../types/types.KeyLike.md)\>