Back to Jose

Interface: CompactVerifyGetKey()

docs/jws/compact/verify/interfaces/CompactVerifyGetKey.md

6.2.92.4 KB
Original Source

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 ParameterDefault typeDescription
KeyType extends CryptoKey | Uint8ArrayCryptoKey | Uint8ArrayType definition of the keys the function resolves. Narrowing it is what lets ResolvedKey.key be inferred at the call site.

ā–ø 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

ParameterTypeDescription
protectedHeaderCompactJWSHeaderParametersJWE or JWS Protected Header.
tokenFlattenedJWSInputThe consumed JWE or JWS token.

Returns

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