Class GenericXECJWKBuilder
- All Implemented Interfaces:
JWKBuilder<GenericXECJWK,,GenericXECJWKBuilder> OKPJWKBuilder<XECPublicKey,,XECPrivateKey, GenericXECJWK, GenericXECJWKBuilder> XECJWKBuilder<GenericXECJWK,,GenericXECJWKBuilder> X509JWKBuilder<XECPublicKey,,XECPrivateKey, GenericXECJWK, GenericXECJWKBuilder> Cloneable
Generic Extended Elliptic Curve JSON Web Key builder implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.jose.internal.jwk.okp.AbstractOKPJWKBuilder
curve, d, xFields inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractX509JWKBuilder
certificate, certPathValidator, keyTrusted, urlResolver, x5c, x5t, x5t_S256, x5uFields inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder
alg, configuration, jwkStore, key, key_ops, keyResolver, kid, use -
Constructor Summary
ConstructorsConstructorDescriptionGenericXECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic XEC JWK builder.GenericXECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) Creates a generic XEC JWK builder initialized with the specified parameters map. -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<GenericXECJWK>doBuild()Builds the JWK after all checks and processing have terminated successfully.protected reactor.core.publisher.Mono<Void>resolve()Resolves the JWK to build.protected reactor.core.publisher.Mono<Void>resolveCertificate(X509Certificate certificate) Resolves the specified certificate into the builder.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.Methods inherited from class io.inverno.mod.security.jose.internal.jwk.okp.AbstractOKPJWKBuilder
curve, privateKey, publicKey, setMethods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractX509JWKBuilder
x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURLMethods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder
algorithm, 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
algorithm, build, keyId, keyOperations, publicKeyUseMethods inherited from interface io.inverno.mod.security.jose.jwk.okp.OKPJWKBuilder
curve, privateKey, publicKeyMethods inherited from interface io.inverno.mod.security.jose.jwk.X509JWKBuilder
x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURL
-
Constructor Details
-
GenericXECJWKBuilder
public GenericXECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic XEC JWK builder.
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolverurlResolver- a JWK URL resolvercertPathValidator- an X.509 certificate path validator
-
GenericXECJWKBuilder
public GenericXECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) throws JWKReadExceptionCreates a generic XEC JWK builder initialized with the specified parameters map.
- Parameters:
configuration- the JOSE module configurationjwkStore- a JWK storekeyResolver- a JWK key resolverurlResolver- a JWK URL resolvercertPathValidator- an X.509 certificate path validatorparameters- a parameters map used to initialize the builder- Throws:
JWKReadException- if there was an error reading the parameters map
-
-
Method Details
-
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<GenericXECJWK,GenericXECJWKBuilder> - 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
-
resolveCertificate
protected reactor.core.publisher.Mono<Void> resolveCertificate(X509Certificate certificate) throws JWKBuildException, JWKResolveException, JWKProcessingException Description copied from class:AbstractX509JWKBuilderResolves the specified certificate into the builder.
This method basically verifies that the certificate is valid and consistent with the builder's parameters and eventually populates the builder with the certificate key.
- Overrides:
resolveCertificatein classAbstractX509JWKBuilder<XECPublicKey,XECPrivateKey, GenericXECJWK, GenericXECJWKBuilder> - Parameters:
certificate- a certificate- Returns:
- an empty single publisher which completes in error if the resolved key is invalid or inconsistent with the builder's parameters
- Throws:
JWKBuildException- if there was an error building the JWKJWKResolveException- if there was an error resolving the certificateJWKProcessingException- if there was a JWK processing error
-
resolveFromJWKStore
Description copied from class:AbstractJWKBuilderTries to resolve the JWK from the JWK store.
- Overrides:
resolveFromJWKStorein classAbstractOKPJWKBuilder<XECPublicKey,XECPrivateKey, GenericXECJWK, GenericXECJWKBuilder> - 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
-
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 classAbstractOKPJWKBuilder<XECPublicKey,XECPrivateKey, GenericXECJWK, GenericXECJWKBuilder> - 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<GenericXECJWK> doBuild() throws JWKBuildException, JWKProcessingExceptionDescription copied from class:AbstractJWKBuilderBuilds the JWK after all checks and processing have terminated successfully.
- Specified by:
doBuildin classAbstractJWKBuilder<GenericXECJWK,GenericXECJWKBuilder> - Returns:
- a single JWK publisher
- Throws:
JWKBuildException- if there was an error building the JWKJWKProcessingException- if there was a JWK processing error
-