Class JwksStoreService

java.lang.Object
org.forgerock.json.jose.jwk.store.JwksStoreService

public class JwksStoreService extends Object
Manage the jwks store, to avoid having more than one jwks store for the same JWKs_URI unnecessary.
  • Field Details

  • Constructor Details

    • JwksStoreService

      Default constructor.
    • JwksStoreService

      public JwksStoreService(int readTimeout, int connTimeout)
      Constructor with read and connection timeout. It's used for the connection to the JWKs_URI.
      Parameters:
      readTimeout - the read timeout
      connTimeout - the connection timeout
    • JwksStoreService

      public JwksStoreService(SimpleHTTPClient simpleHTTPClient)
      Constructor with a HTTP client, that will be used to connect to the JWKS_URI.
      Parameters:
      simpleHTTPClient - the HTTP client
  • Method Details

    • getJwksStore

      Returns the appropriate JWKs store.
      Parameters:
      uid - Reference to the jwks store. Note that the uid check is case insensitive
      Returns:
      a JWKs Store for the corresponding UID. If doesn't exist, returns null
    • configureJwksStore

      public JwksStore configureJwksStore(String uid, Duration cacheTimeout, Duration cacheMissCacheTime, URL jwkUrl) throws FailedToLoadJWKException
      Configure a JWKs store.
      Parameters:
      uid - the unique identifier for this store
      cacheTimeout - a cache timeout to avoid reloading the cache all the time when doing encryption
      cacheMissCacheTime - the cache time before reload the cache in case of cache miss.
      jwkUrl - the jwk url hosted by the client application
      Returns:
      the JWKs store corresponding
      Throws:
      FailedToLoadJWKException - if the jwks can't be reloaded.
    • removeJwksStore

      public void removeJwksStore(String uid)
      Remove the corresponding jwks store if exist.
      Parameters:
      uid - the uid. Note that the uid check isn't case sensitive