import { Jwk } from './jwk'; /** * Singleton service class to register and retrieve JSON Web Keys. */ export declare class JwkStore { private static instance; protected localCryptoKeys: [RegExp, Jwk[]][]; protected remoteCryptoOrigins: string[]; protected remoteCryptoCache: Map; protected constructor(); /** * Retrieves the singleton instance of this service class. * * @returns the singleton instance */ static getInstance(): JwkStore; /** * Register a new trustworthy URL to retrieve JSON Web Keys from. * * @param url the URL to register */ addHost(url: string): void; /** * Registers a new set of JSON Web Keys in the store. It is possible to * register multiple keys for a single environment in order to account for * key renewals with a transition period. * * @param test a regular expression to check if this key is applicable * @param jwk the JSON Web Key(s) to register */ addJwk(test: RegExp, ...jwk: Jwk[]): void; /** * Retrieves a set of JSON Web Keys for the given environment URL. * * @param iss the environment URL provided in the `iss` claim of the token * @returns a promise holding the corresponding Crypto keys */ getJwk(iss: string, jku?: string): Promise; /** * Retrieves a JSON Web Key from the given URL. * * @param url the remote URL that hosts the JWK data * @param timeout the request timeout in milliseconds * @returns a promise holding the corresponding Crypto key */ loadJwk(url: string, timeout?: number): Promise; /** * Resets the store. */ reset(): void; }