Back to Jose

Interface: FlattenedVerifyGetKey()

docs/jws/flattened/verify/interfaces/FlattenedVerifyGetKey.md

6.2.122.3 KB
Original Source

Interface: FlattenedVerifyGetKey()<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.

Resolves a key for Flattened JWS verification from unverified headers and token data.

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.

ā–ø FlattenedVerifyGetKey(protectedHeader, token): JWK | KeyObject | KeyType | Promise<JWK | KeyObject | KeyType>

Resolves a key for an unverified token. Throw if no suitable key can be resolved.

Parameters

ParameterTypeDescription
protectedHeaderJWSHeaderParametersJWE or JWS Protected Header.
tokenFlattenedJWSInputThe consumed JWE or JWS token; none of its components have been verified.

Returns

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