Class JwksStore
java.lang.Object
org.forgerock.json.jose.jwk.store.JwksStore
Store JWKs into a jwkSet from a JWKs_URI and refresh the jwkSet when necessary.
-
Method Summary
Modifier and TypeMethodDescriptionSearch for a JWK that matches the kid.Search for a JWK that matches the algorithm and the key usage.Get the cache time before reload the cache in case of cache miss.Get the cache timeout.The JWKs URI.getUid()
Get the UID.void
setCacheMissCacheTime
(Duration cacheMissCacheTime) Update the cache time before reload the cache in case of cache miss.void
setCacheTimeout
(Duration cacheTimeout) Update the cache timeout.void
Update the JWKs URI.
-
Method Details
-
findJwk
Search for a JWK that matches the algorithm and the key usage.- Parameters:
algorithm
- the algorithm neededkeyUse
- the key usage. If null, only the algorithm will be used as a search criteria.- Returns:
- A jwk that matches the search criteria. If no JWK found for the key usage, then it searches for a JWK without key usage defined. If still no JWK found, then returns null.
- Throws:
FailedToLoadJWKException
- if the jwks can't be reloaded.
-
findJwk
Search for a JWK that matches the kid.- Parameters:
kid
- Key ID- Returns:
- A jwk that matches the kid. If no JWK found, returns null
- Throws:
FailedToLoadJWKException
- if the jwks can't be reloaded.
-
getUid
Get the UID.- Returns:
- the uid.
-
getCacheTimeout
Get the cache timeout.- Returns:
- the cache timeout.
-
getCacheMissCacheTime
Get the cache time before reload the cache in case of cache miss.- Returns:
- the cache miss cache time.
-
getJwkUrl
The JWKs URI.- Returns:
- the jwk uri.
-
setCacheTimeout
Update the cache timeout.- Parameters:
cacheTimeout
- the cache timeout.
-
setCacheMissCacheTime
Update the cache time before reload the cache in case of cache miss.- Parameters:
cacheMissCacheTime
- the cache miss cache time.
-
setJwkUrl
Update the JWKs URI.- Parameters:
jwkUrl
- the jwks uri.- Throws:
FailedToLoadJWKException
- If the URI has changed and the JWK set cannot be loaded.
-