Package com.nimbusds.jose.jwk.source
Class JWKSetBasedJWKSource<C extends SecurityContext>
java.lang.Object
com.nimbusds.jose.jwk.source.JWKSetBasedJWKSource<C>
- All Implemented Interfaces:
JWKSource<C>
,Closeable
,AutoCloseable
@ThreadSafe
public class JWKSetBasedJWKSource<C extends SecurityContext>
extends Object
implements JWKSource<C>, Closeable
JSON Web Key (JWK) set based JWK source.
- Version:
- 2022-11-22
- Author:
- Thomas Rørvik Skjølberg, Vladimir Dzhuvinov
-
Constructor Summary
ConstructorDescriptionJWKSetBasedJWKSource
(JWKSetSource<C> source) Creates a new JWK set based JWK source. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
get
(JWKSelector jwkSelector, C context) Retrieves a list of JWKs matching the specified selector.Returns the underlying JWK set source.
-
Constructor Details
-
JWKSetBasedJWKSource
Creates a new JWK set based JWK source.- Parameters:
source
- The JWK set source. Must not benull
.
-
-
Method Details
-
get
Description copied from interface:JWKSource
Retrieves a list of JWKs matching the specified selector.- Specified by:
get
in interfaceJWKSource<C extends SecurityContext>
- Parameters:
jwkSelector
- A JWK selector. Must not benull
.context
- Optional context,null
if not required.- Returns:
- The matching JWKs, empty list if no matches were found.
- Throws:
KeySourceException
- If key sourcing failed.
-
getJWKSetSource
Returns the underlying JWK set source.- Returns:
- The JWK set source.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-