@gaonengwww/jose
Version:
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
11 lines (8 loc) • 881 B
TypeScript
import { JWTPayload, CryptoKey, KeyObject, JWK, VerifyOptions, JWTClaimVerificationOptions, JWTVerifyResult, GenericGetKeyFunction, JWTHeaderParameters, FlattenedJWSInput, ResolvedKey } from '../types.d.js';
interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions {
}
interface JWTVerifyGetKey extends GenericGetKeyFunction<JWTHeaderParameters, FlattenedJWSInput, CryptoKey | KeyObject | JWK | Uint8Array> {
}
declare function jwtVerify<PayloadType = JWTPayload>(jwt: string | Uint8Array, key: CryptoKey | KeyObject | JWK | Uint8Array, options?: JWTVerifyOptions): Promise<JWTVerifyResult<PayloadType>>;
declare function jwtVerify<PayloadType = JWTPayload>(jwt: string | Uint8Array, getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<JWTVerifyResult<PayloadType> & ResolvedKey>;
export { type JWTVerifyGetKey, type JWTVerifyOptions, jwtVerify };