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>,java.io.Closeable,java.lang.AutoCloseable
@ThreadSafe public class URLBasedJWKSetSource<C extends SecurityContext> extends java.lang.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(java.net.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(java.net.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 java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-