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 aURL, without health status reporting.- Version:
- 2022-11-22
- Author:
- Thomas Rørvik Skjølberg, Vladimir Dzhuvinov
-
-
Constructor Summary
Constructors Constructor Description URLBasedJWKSetSource(URL url, ResourceRetriever resourceRetriever)Creates a new URL based JWK set source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()JWKSetgetJWKSet(JWKSetCacheRefreshEvaluator refreshEvaluator, long currentTime, C context)Gets the JWK set.
-
-
-
Constructor Detail
-
URLBasedJWKSetSource
public URLBasedJWKSetSource(URL url, ResourceRetriever resourceRetriever)
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 Detail
-
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
public void close() throws IOException
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-