Files
jose/docs/jws/compact/verify/interfaces/CompactVerifyGetKey.md
T
Filip Skokan f7ef7912cd docs: correct subpaths and API documentation
Correct subpath names that otherwise lead users to unexported entries,
and fix examples, links, and missing descriptions in published JSDoc.

Use instanceof in JWKS recovery examples so strict TypeScript can
narrow caught errors.

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

2.3 KiB

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

See

createRemoteJWKSet to verify using a remote JSON Web Key Set.

Type Parameters

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

â–¸ CompactVerifyGetKey(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 CompactJWSHeaderParameters JWE or JWS Protected Header.
token FlattenedJWSInput The consumed JWE or JWS token.

Returns

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