Class GenericOCTJWKBuilder
- All Implemented Interfaces:
JWKBuilder<GenericOCTJWK,,GenericOCTJWKBuilder> OCTJWKBuilder<GenericOCTJWK,,GenericOCTJWKBuilder> Cloneable
Generic Octet 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
ConstructorsConstructorDescriptionGenericOCTJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver) Creates a generic OCT JWK builder.GenericOCTJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, Map<String, Object> parameters) Creates a generic OCT JWK builder initialized with the specified parameters map. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the algorithm intended for use with the key.reactor.core.publisher.Mono<GenericOCTJWK>doBuild()Builds the JWK after all checks and processing have terminated successfully.Specifies the key value 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
-
GenericOCTJWKBuilder
public GenericOCTJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver) Creates a generic OCT JWK builder.
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolver
-
GenericOCTJWKBuilder
public GenericOCTJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, Map<String, Object> parameters) throws JWKReadExceptionCreates a generic OCT 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<GenericOCTJWK,GenericOCTJWKBuilder> - 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<GenericOCTJWK,GenericOCTJWKBuilder> - Overrides:
algorithmin classAbstractJWKBuilder<GenericOCTJWK,GenericOCTJWKBuilder> - Parameters:
alg- a JWA algorithm- Returns:
- this builder
-
keyValue
Description copied from interface:OCTJWKBuilderSpecifies the key value encoded as Base64URL.
- Specified by:
keyValuein interfaceOCTJWKBuilder<GenericOCTJWK,GenericOCTJWKBuilder> - Parameters:
k- the Base64URL encoded key value with no padding- Returns:
- this builder
-
resolveFromJWKStore
Description copied from class:AbstractJWKBuilderTries to resolve the JWK from the JWK store.
- Overrides:
resolveFromJWKStorein classAbstractJWKBuilder<GenericOCTJWK,GenericOCTJWKBuilder> - 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<GenericOCTJWK,GenericOCTJWKBuilder> - 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<GenericOCTJWK,GenericOCTJWKBuilder> - 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
public reactor.core.publisher.Mono<GenericOCTJWK> doBuild() throws JWKBuildException, JWKProcessingExceptionDescription copied from class:AbstractJWKBuilderBuilds the JWK after all checks and processing have terminated successfully.
- Specified by:
doBuildin classAbstractJWKBuilder<GenericOCTJWK,GenericOCTJWKBuilder> - Returns:
- a single JWK publisher
- Throws:
JWKBuildException- if there was an error building the JWKJWKProcessingException- if there was a JWK processing error
-