Package com.nimbusds.jose.jwk.source
Class URLBasedJWKSetSource<C extends SecurityContext>
java.lang.Object
com.nimbusds.jose.jwk.source.URLBasedJWKSetSource<C>
- All Implemented Interfaces:
JWKSetSource<C>,Closeable,AutoCloseable
@ThreadSafe
public class URLBasedJWKSetSource<C extends SecurityContext>
extends Object
implements JWKSetSource<C>
JWK set source that loads the keys from a
URL, without health status
reporting.- Version:
- 2022-11-22
- Author:
- Thomas Rørvik Skjølberg, Vladimir Dzhuvinov
-
Constructor Summary
ConstructorsConstructorDescriptionURLBasedJWKSetSource(URL url, ResourceRetriever resourceRetriever) Creates a new URL based JWK set source. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getJWKSet(JWKSetCacheRefreshEvaluator refreshEvaluator, long currentTime, C context) Gets the JWK set.
-
Constructor Details
-
URLBasedJWKSetSource
Creates a new URL based JWK set source.- Parameters:
url- The JWK set URL. Must not benull.resourceRetriever- The resource retriever to use. Must not benull.
-
-
Method Details
-
getJWKSet
public JWKSet getJWKSet(JWKSetCacheRefreshEvaluator refreshEvaluator, long currentTime, C context) throws KeySourceException Description copied from interface:JWKSetSourceGets the JWK set.- Specified by:
getJWKSetin interfaceJWKSetSource<C extends SecurityContext>- Parameters:
refreshEvaluator- Controls whether refresh of the JWK set cache (if utilised by the source) is required.currentTime- The current time, in milliseconds since the Unix epoch.context- Optional context,nullif not required.- Returns:
- The JWK set.
- Throws:
KeySourceException- If JWK set retrieval failed.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-