Files
jose/docs/jwe/compact/decrypt/interfaces/CompactDecryptGetKey.md
T
Filip Skokan acb2913e8e refactor(types): improve key and result inference
Thread resolver return types through verify and decrypt results. Add
overloads so wrappers can forward either keys or resolvers.

Infer importJWK and generateSecret results from their inputs. Keep JWT
payload generics unconstrained while rejecting known non-object shapes.

Signed-off-by: Filip Skokan <[email protected]>
2026-07-29 18:50:54 +02:00

2.1 KiB

Interface: CompactDecryptGetKey()<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 Compact JWE Decryption dynamic key resolution. No token components have been verified at the time of this function call.

Type Parameters

Type Parameter Default type
KeyType extends CryptoKey | Uint8Array CryptoKey | Uint8Array

â–¸ CompactDecryptGetKey(protectedHeader, token): KeyObject | JWK | KeyType | Promise<KeyObject | JWK | 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

KeyObject | JWK | KeyType | Promise<KeyObject | JWK | KeyType>