Module io.inverno.mod.security.jose
Class AbstractJWKFactory<A extends AbstractJWK,B extends AbstractJWKBuilder<A,B>,C extends AbstractJWKGenerator<A,C>>
java.lang.Object
io.inverno.mod.security.jose.internal.jwk.AbstractJWKFactory<A,B,C>
- Type Parameters:
A- the JWK typeB- the JWK builder typeC- the JWK generator type
- All Implemented Interfaces:
JWKFactory<A,B, C>
- Direct Known Subclasses:
AbstractX509JWKFactory,GenericOCTJWKFactory,GenericPBES2JWKFactory
public abstract class AbstractJWKFactory<A extends AbstractJWK,B extends AbstractJWKBuilder<A,B>,C extends AbstractJWKGenerator<A,C>>
extends Object
implements JWKFactory<A,B,C>
Base JSON Web Key factory implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JOSEConfigurationThe JOSE module configuration.protected final JWKStoreThe JWK Key store.protected final JWKKeyResolverThe JWK Key resolver.protected final com.fasterxml.jackson.databind.ObjectMapperThe object mapper. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJWKFactory(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JWK factory -
Method Summary
Modifier and TypeMethodDescriptionabstract BReturns a new JWK builder initialized with the specified parameters map.reactor.core.publisher.Mono<A>Generates a new key using the specified parameters.abstract CReturns a new JWK generator initialized with the specified parameters map.reactor.core.publisher.Mono<A>Reads the specified JWK or JWK set serialized as JSON.reactor.core.publisher.Mono<A>Read the specified JWK or JWK set represented in the specified map.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.jwk.JWKFactory
builder, generator, supports, supportsAlgorithm
-
Field Details
-
configuration
The JOSE module configuration. -
jwkStore
The JWK Key store. -
keyResolver
The JWK Key resolver. -
mapper
protected final com.fasterxml.jackson.databind.ObjectMapper mapperThe object mapper.
-
-
Constructor Details
-
AbstractJWKFactory
public AbstractJWKFactory(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a JWK factory
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolvermapper- an object mapper
-
-
Method Details
-
read
public reactor.core.publisher.Mono<A> read(String jwk) throws JWKReadException, JWKBuildException, JWKResolveException, JWKProcessingException Description copied from interface:JWKFactoryReads the specified JWK or JWK set serialized as JSON.
- Specified by:
readin interfaceJWKFactory<A extends AbstractJWK,B extends AbstractJWKBuilder<A, B>, C extends AbstractJWKGenerator<A, C>> - Parameters:
jwk- a JSON serialized JWK or JWK set- Returns:
- a publisher of keys
- Throws:
JWKReadException- if there was an error reading the input or a particular keyJWKBuildException- if there was an error building a keyJWKResolveException- if there was an error resolving a keyJWKProcessingException- if there was an error processing a key
-
read
public reactor.core.publisher.Mono<A> read(Map<String, Object> jwk) throws JWKReadException, JWKBuildException, JWKResolveException, JWKProcessingExceptionDescription copied from interface:JWKFactoryRead the specified JWK or JWK set represented in the specified map.
- Specified by:
readin interfaceJWKFactory<A extends AbstractJWK,B extends AbstractJWKBuilder<A, B>, C extends AbstractJWKGenerator<A, C>> - Parameters:
jwk- a map representing a JWK or a JWK set- Returns:
- a publisher of keys
- Throws:
JWKReadException- if there was an error reading the input or a particular keyJWKBuildException- if there was an error building a keyJWKResolveException- if there was an error resolving a keyJWKProcessingException- if there was an error processing a key
-
generate
public reactor.core.publisher.Mono<A> generate(String alg, Map<String, Object> parameters) throws JWKGenerateException, JWKProcessingExceptionDescription copied from interface:JWKFactoryGenerates a new key using the specified parameters.
This is a convenience method, you should prefer using
JWKFactory.generator()which is more robust.- Specified by:
generatein interfaceJWKFactory<A extends AbstractJWK,B extends AbstractJWKBuilder<A, B>, C extends AbstractJWKGenerator<A, C>> - Parameters:
alg- a JWA algorithmparameters- a map of key parameters- Returns:
- a single publisher of key
- Throws:
JWKGenerateException- if there was an error generating the keyJWKProcessingException- if there was a processing error
-
builder
Returns a new JWK builder initialized with the specified parameters map.
- Parameters:
parameters- a parameters map- Returns:
- a new JWK builder
-
generator
Returns a new JWK generator initialized with the specified parameters map.
- Parameters:
alg- a JWK algorithmparameters- a parameters map- Returns:
- a new JWK generator
-