Class SwitchableJWKURLResolver
- All Implemented Interfaces:
JWKURLResolver
A wrapper for the JWKURLResolver which can switch off JWK Set URL and X.509 certificate URL resolution by configuration.
The JWKURLResolver is used in GenericJWKService.read(java.net.URI) to resolve JWK sets explicitly and indirectly in JOSEObjectBuilder to resolve keys from the jku
properties. We only want to disable resolution when building or reading JOSE objects and always have it enabled otherwise.
The URL resolution can be disabled by configuration (see JOSEConfiguration.resolve_jku() and JOSEConfiguration.resolve_x5u()).
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorsConstructorDescriptionSwitchableJWKURLResolver(JOSEConfiguration configuration, JWKURLResolver urlResolver) Wraps the specified JWK URL resolver to make it switchable. -
Method Summary
Modifier and TypeMethodDescriptionresolveJWKSetURL(URI jku) Resolves a JSON JWK or JWK set at the specified location and returns corresponding keys represented as maps.reactor.core.publisher.Mono<List<X509Certificate>>Resolves the X.509 certificates chain at the specified location as defined by RFC7515 Section 4.1.5
-
Constructor Details
-
SwitchableJWKURLResolver
Wraps the specified JWK URL resolver to make it switchable.
- Parameters:
configuration- the JOSE module configurationurlResolver- the modume JWK URL resolver
-
-
Method Details
-
resolveJWKSetURL
public org.reactivestreams.Publisher<Map<String,Object>> resolveJWKSetURL(URI jku) throws JWKResolveException Description copied from interface:JWKURLResolverResolves a JSON JWK or JWK set at the specified location and returns corresponding keys represented as maps.
- Specified by:
resolveJWKSetURLin interfaceJWKURLResolver- Parameters:
jku- the URI of the JSON JWK or JWK set resource- Returns:
- a publisher of parsed keys represented as maps
- Throws:
JWKResolveException- if there was an error resolving the resource
-
resolveX509CertificateURL
public reactor.core.publisher.Mono<List<X509Certificate>> resolveX509CertificateURL(URI x5u) throws JWKResolveException Description copied from interface:JWKURLResolverResolves the X.509 certificates chain at the specified location as defined by RFC7515 Section 4.1.5
- Specified by:
resolveX509CertificateURLin interfaceJWKURLResolver- Parameters:
x5u- the URI of the X.509 certificate chain- Returns:
- a single X.509 certificates chain publisher
- Throws:
JWKResolveException- if there was an error resolving the certificates chain
-