Module io.inverno.mod.security.jose
Class GenericPBES2JWKGenerator
java.lang.Object
io.inverno.mod.security.jose.internal.jwk.AbstractJWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator>
io.inverno.mod.security.jose.internal.jwk.pbes2.GenericPBES2JWKGenerator
- All Implemented Interfaces:
JWKGenerator<GenericPBES2JWK,,GenericPBES2JWKGenerator> PBES2JWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator>
public class GenericPBES2JWKGenerator
extends AbstractJWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator>
implements PBES2JWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator>
Generic Password-based JSON Web Key generator implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKGenerator
alg, key_ops, kid, use -
Constructor Summary
ConstructorsConstructorDescriptionCreates a generic PBES2 JWK generator.GenericPBES2JWKGenerator(Map<String, Object> parameters) Creates a generic PBES2 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<GenericPBES2JWK>Generates the JWK after all checks and processing have terminated successfully.length(int length) Specifies the length of the password to generate in bytes.randomStringGenerator(org.apache.commons.text.RandomStringGenerator randomStringGenerator) Specifies the random string generator to use to generate the password.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
-
Constructor Details
-
GenericPBES2JWKGenerator
public GenericPBES2JWKGenerator()Creates a generic PBES2 JWK generator.
-
GenericPBES2JWKGenerator
Creates a generic PBES2 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<GenericPBES2JWK,GenericPBES2JWKGenerator> - 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<GenericPBES2JWK,GenericPBES2JWKGenerator> - Overrides:
algorithmin classAbstractJWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator> - Parameters:
alg- a JWA algorithm- Returns:
- this generator
-
length
Description copied from interface:PBES2JWKGeneratorSpecifies the length of the password to generate in bytes.
- Specified by:
lengthin interfacePBES2JWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator> - Parameters:
length- the length of the password in bytes- Returns:
- this builder
-
randomStringGenerator
public GenericPBES2JWKGenerator randomStringGenerator(org.apache.commons.text.RandomStringGenerator randomStringGenerator) Description copied from interface:PBES2JWKGeneratorSpecifies the random string generator to use to generate the password.
If not specified a default random string generator will be used.
- Specified by:
randomStringGeneratorin interfacePBES2JWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator> - Parameters:
randomStringGenerator- a random string generator- Returns:
- this builder
-
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<GenericPBES2JWK,GenericPBES2JWKGenerator> - 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<GenericPBES2JWK> doGenerate() throws JWKGenerateException, JWKProcessingExceptionDescription copied from class:AbstractJWKGeneratorGenerates the JWK after all checks and processing have terminated successfully.
- Specified by:
doGeneratein classAbstractJWKGenerator<GenericPBES2JWK,GenericPBES2JWKGenerator> - Returns:
- a single JWK publisher
- Throws:
JWKGenerateException- if there was an error generating the JWKJWKProcessingException- if there was a JWK processing error
-