Class CachedJwkGenerator

Generates a key pair once and then caches it using both an internal variable and a KeyValueStorage. The storage makes sure the keys remain the same between server restarts, while the internal variable makes it so the storage doesn't have to be accessed every time a key is needed.

Only the private key is stored in the internal storage, using the storageKey parameter. The public key is determined based on the private key and then also stored in memory.

Hierarchy

  • CachedJwkGenerator

Implements

Constructors

Properties

alg: AsymmetricSigningAlgorithm

The algorithm used for the keys.

key: string
privateJwk?: AlgJwk
publicJwk?: AlgJwk
storage: KeyValueStorage<string, JWKS>

Methods