Module io.inverno.mod.security.jose
Class GenericRSAJWKGenerator
java.lang.Object
io.inverno.mod.security.jose.internal.jwk.AbstractJWKGenerator<C,D>
io.inverno.mod.security.jose.internal.jwk.AbstractX509JWKGenerator<RSAPublicKey,RSAPrivateKey,GenericRSAJWK,GenericRSAJWKGenerator>
io.inverno.mod.security.jose.internal.jwk.rsa.GenericRSAJWKGenerator
- All Implemented Interfaces:
JWKGenerator<GenericRSAJWK,,GenericRSAJWKGenerator> RSAJWKGenerator<GenericRSAJWK,,GenericRSAJWKGenerator> X509JWKGenerator<RSAPublicKey,RSAPrivateKey, GenericRSAJWK, GenericRSAJWKGenerator>
public class GenericRSAJWKGenerator
extends AbstractX509JWKGenerator<RSAPublicKey,RSAPrivateKey,GenericRSAJWK,GenericRSAJWKGenerator>
implements RSAJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator>
Generic RSA JSON Web Key generator implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default key size.static final intThe minimum key size.Fields inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKGenerator
alg, key_ops, kid, use -
Constructor Summary
ConstructorsConstructorDescriptionCreates a generic RSA JWK generator.GenericRSAJWKGenerator(Map<String, Object> parameters) Creates a generic RSA JWK generator initialized with the specified parameters map. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the algorithm intended for use with the key.protected reactor.core.publisher.Mono<GenericRSAJWK>Generates the JWK after all checks and processing have terminated successfully.keySize(int keySize) Specifies the size of the key to generate in bytes.protected voidSets the specified parameter into the generator.protected reactor.core.publisher.Mono<Void>verify()Verifies that the generator's parameters are consistent and that we can proceed with the generation of the key.Methods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKGenerator
generate, keyId, keyOperations, publicKeyUseMethods 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.JWKGenerator
generate, keyId, keyOperations, publicKeyUse
-
Field Details
-
MINIMUM_KEY_SIZE
public static final int MINIMUM_KEY_SIZEThe minimum key size.- See Also:
-
DEFAULT_KEY_SIZE
public static final int DEFAULT_KEY_SIZEThe default key size.- See Also:
-
-
Constructor Details
-
GenericRSAJWKGenerator
public GenericRSAJWKGenerator()Creates a generic RSA JWK generator.
-
GenericRSAJWKGenerator
Creates a generic RSA JWK generator initialized with the specified parameters map.
- Parameters:
parameters- a parameters map used to initialize the generator- Throws:
JWKGenerateException- if there was an error reading the parameters map
-
-
Method Details
-
set
Description copied from class:AbstractJWKGeneratorSets the specified parameter into the generator.
Unsupported parameters are ignored.
- Overrides:
setin classAbstractJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Parameters:
field- the parameter namevalue- the parameter value- Throws:
JWKGenerateException- if there was an error reading the value
-
algorithm
Description copied from interface:JWKGeneratorSpecifies the algorithm intended for use with the key.
- Specified by:
algorithmin interfaceJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Overrides:
algorithmin classAbstractJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Parameters:
alg- a JWA algorithm- Returns:
- this generator
-
keySize
Description copied from interface:RSAJWKGeneratorSpecifies the size of the key to generate in bytes.
- Specified by:
keySizein interfaceRSAJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Parameters:
keySize- the size of the key in bytes- Returns:
- this generator
-
verify
protected reactor.core.publisher.Mono<Void> verify() throws JWKGenerateException, JWKProcessingExceptionDescription copied from class:AbstractJWKGeneratorVerifies that the generator's parameters are consistent and that we can proceed with the generation of the key.
- Overrides:
verifyin classAbstractJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Returns:
- an empty single publisher which completes in error if generator's parameters are invalid or inconsistent
- Throws:
JWKGenerateException- if there was an error generating the JWKJWKProcessingException- if there was a JWK processing error
-
doGenerate
protected reactor.core.publisher.Mono<GenericRSAJWK> doGenerate() throws JWKGenerateException, JWKProcessingExceptionDescription copied from class:AbstractJWKGeneratorGenerates the JWK after all checks and processing have terminated successfully.
- Specified by:
doGeneratein classAbstractJWKGenerator<GenericRSAJWK,GenericRSAJWKGenerator> - Returns:
- a single JWK publisher
- Throws:
JWKGenerateException- if there was an error generating the JWKJWKProcessingException- if there was a JWK processing error
-