import { JwtClaims } from './jwt-claims'; import { JwtHeader } from './jwt-header'; /** * Service class providing functionality to handle and verify JSON Web Tokens. */ export declare class JwtHandler { /** * Decodes a Base64Url encoded JSON Web Token header. * * @param token the JWT token * @returns the decoded JSON header parameters or `null` if it is not a JWT token */ decodeJwtHeader(token: string): JwtHeader | null; /** * Decodes a Base64Url encoded JSON Web Token. * * @param token the JWT token * @returns the decoded JSON object or `null` if it is not a JWT token */ decodeJwtClaims(token: string): JwtClaims | null; /** * Verifies the signature of the given JSON Web Token against a set of keys. * Only one of the keys needs to match in order to resolve the resulting * promise. * * @param token the JWT token * @param key the set of keys to check the token against * @returns an empty promise that resolves if the token is valid */ verifyJwt(token: string, ...keys: CryptoKey[]): Promise; /** * Validates the given decoded JWT token. Checks if the given claims align * with the validation claims. Furthermore the token's `nbf` and `exp` claims * are checked if they are defined in the token. A small leeway, usually no * more than a few minutes, may be used to account for clock skew. * * @param claims the decoded JWT token * @param validation the reference claims to check * @param leeway a small leeway to account for clock skew * @returns an empty promise that resolves if the token is valid */ validateJwt(claims: JwtClaims, validation: { iss?: string; sub?: string; aud?: string; jti?: string; }, leeway?: number): Promise; private isJwt; }