Class GenericPBES2JWKBuilder
- All Implemented Interfaces:
JWKBuilder<GenericPBES2JWK,,GenericPBES2JWKBuilder> PBES2JWKBuilder<GenericPBES2JWK,,GenericPBES2JWKBuilder> Cloneable
Generic Password-based JSON Web Key builder implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder
alg, configuration, jwkStore, key, key_ops, keyResolver, kid, use -
Constructor Summary
ConstructorsConstructorDescriptionGenericPBES2JWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver) Creates a generic PBES2 JWK builder.GenericPBES2JWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, Map<String, Object> parameters) Creates a generic PBES2 JWK builder 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>doBuild()Builds the JWK after all checks and processing have terminated successfully.Specifies the password encoded as Base64URL.protected reactor.core.publisher.Mono<Void>resolve()Resolves the JWK to build.protected reactor.core.publisher.Mono<JWK>Tries to resolve the JWK from the JWK store.protected reactor.core.publisher.Mono<Void>resolveKey(Key key) Resolves the specified key into the builder.protected voidSets the specified parameter into the builder.Methods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder
build, 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.JWKBuilder
build, keyId, keyOperations, publicKeyUse
-
Constructor Details
-
GenericPBES2JWKBuilder
public GenericPBES2JWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver) Creates a generic PBES2 JWK builder.
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolver
-
GenericPBES2JWKBuilder
public GenericPBES2JWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, Map<String, Object> parameters) throws JWKReadExceptionCreates a generic PBES2 JWK builder initialized with the specified parameters map.
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolverparameters- a parameters map used to initialize the builder- Throws:
JWKReadException- if there was an error reading the parameters map
-
-
Method Details
-
set
Description copied from class:AbstractJWKBuilderSets the specified parameter into the builder.
Unsupported parameters are ignored.
- Overrides:
setin classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Parameters:
field- the parameter namevalue- the parameter value- Throws:
JWKReadException- if there was an error reading the value
-
algorithm
Description copied from interface:JWKBuilderSpecifies the algorithm intended for use with the key.
- Specified by:
algorithmin interfaceJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Overrides:
algorithmin classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Parameters:
alg- a JWA algorithm- Returns:
- this builder
-
password
Description copied from interface:PBES2JWKBuilderSpecifies the password encoded as Base64URL.
- Specified by:
passwordin interfacePBES2JWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Parameters:
password- the Base64URL encoded password with no padding- Returns:
- this builder
-
resolveFromJWKStore
Description copied from class:AbstractJWKBuilderTries to resolve the JWK from the JWK store.
- Overrides:
resolveFromJWKStorein classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Returns:
- a single JWK publisher or an empty publisher if there's no JWK corresponding to the builder's parameters in the JWK store
- Throws:
JWKResolveException- if there was an error accessing the JWK store
-
resolveKey
protected reactor.core.publisher.Mono<Void> resolveKey(Key key) throws JWKBuildException, JWKResolveException, JWKProcessingException Description copied from class:AbstractJWKBuilderResolves the specified key into the builder.
This method basically verifies that the key is valid and consistent with the builder's parameters and eventually populates the builder with the key.
- Specified by:
resolveKeyin classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Parameters:
key- a key- Returns:
- an empty single publisher which completes in error if the key is not consistent with the builder's parameters
- Throws:
JWKBuildException- if there was an error building the JWKJWKResolveException- if there was an error resolving the keyJWKProcessingException- if there was a JWK processing error
-
resolve
protected reactor.core.publisher.Mono<Void> resolve() throws JWKBuildException, JWKResolveException, JWKProcessingExceptionDescription copied from class:AbstractJWKBuilderResolves the JWK to build.
This method basically resolves resources such as keys or certificates and verifies that the builder's parameters are consistent.
- Overrides:
resolvein classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Returns:
- an empty single publisher which completes in error if the key is not consistent with the builder's parameters
- Throws:
JWKBuildException- if there was an error building the JWKJWKResolveException- if there was an error resolving the JWKJWKProcessingException- if there was a JWK processing error
-
doBuild
protected reactor.core.publisher.Mono<GenericPBES2JWK> doBuild() throws JWKBuildException, JWKProcessingExceptionDescription copied from class:AbstractJWKBuilderBuilds the JWK after all checks and processing have terminated successfully.
- Specified by:
doBuildin classAbstractJWKBuilder<GenericPBES2JWK,GenericPBES2JWKBuilder> - Returns:
- a single JWK publisher
- Throws:
JWKBuildException- if there was an error building the JWKJWKProcessingException- if there was a JWK processing error
-