mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
2.3 KiB
2.3 KiB
Interface: JWTDecryptGetKey()<KeyType>
💗 Help the project
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
Interface for JWT Decryption dynamic key resolution. No token components have been verified at the time of this function call.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
KeyType extends CryptoKey | Uint8Array |
CryptoKey | Uint8Array |
Type definition of the keys the function resolves. Narrowing it is what lets ResolvedKey.key be inferred at the call site. |
â–¸ JWTDecryptGetKey(protectedHeader, token): JWK | KeyObject | KeyType | Promise<JWK | KeyObject | KeyType>
Dynamic key resolution function. No token components have been verified at the time of this function call. If a suitable key for the token cannot be matched, throw an error instead.
Parameters
| Parameter | Type | Description |
|---|---|---|
protectedHeader |
CompactJWEHeaderParameters |
JWE or JWS Protected Header. |
token |
FlattenedJWE |
The consumed JWE or JWS token. |
Returns
JWK | KeyObject | KeyType | Promise<JWK | KeyObject | KeyType>