Class GenericECJWKBuilder
- All Implemented Interfaces:
ECJWKBuilder<GenericECJWK,,GenericECJWKBuilder> JWKBuilder<GenericECJWK,,GenericECJWKBuilder> X509JWKBuilder<ECPublicKey,,ECPrivateKey, GenericECJWK, GenericECJWKBuilder> Cloneable
Generic 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.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
ConstructorsConstructorDescriptionGenericECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic EC JWK builder.GenericECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) Creates a generic EC JWK builder initialized with the specified parameters map. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the algorithm intended for use with the key.Specifies the Elliptic curve JWA name.protected reactor.core.publisher.Mono<GenericECJWK>doBuild()Builds the JWK after all checks and processing have terminated successfully.Specifies the ECC private key encoded as Base64URL.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.protected voidSets the specified parameter into the builder.Specifies the X coordinate encoded as Base64URL.Specifies the Y coordinate encoded as Base64URL.Methods 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
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, publicKeyUseMethods inherited from interface io.inverno.mod.security.jose.jwk.X509JWKBuilder
x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURL
-
Constructor Details
-
GenericECJWKBuilder
public GenericECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic EC 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
-
GenericECJWKBuilder
public GenericECJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) throws JWKReadExceptionCreates a generic EC 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
-
set
Description copied from class:AbstractX509JWKBuilderSets the specified parameter into the builder.
Unsupported parameters are ignored.
- Overrides:
setin classAbstractX509JWKBuilder<ECPublicKey,ECPrivateKey, GenericECJWK, GenericECJWKBuilder> - 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<GenericECJWK,GenericECJWKBuilder> - Overrides:
algorithmin classAbstractJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Parameters:
alg- a JWA algorithm- Returns:
- this builder
-
curve
Description copied from interface:ECJWKBuilderSpecifies the Elliptic curve JWA name.
- Specified by:
curvein interfaceECJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Parameters:
crv- the JWA Elliptic curve name- Returns:
- this builder
-
xCoordinate
Description copied from interface:ECJWKBuilderSpecifies the X coordinate encoded as Base64URL.
- Specified by:
xCoordinatein interfaceECJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Parameters:
x- the Base64URL encoded X coordinate with no padding- Returns:
- this builder
-
yCoordinate
Description copied from interface:ECJWKBuilderSpecifies the Y coordinate encoded as Base64URL.
- Specified by:
yCoordinatein interfaceECJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Parameters:
y- the Base64URL encoded Y coordinate with no padding- Returns:
- this builder
-
eccPrivateKey
Description copied from interface:ECJWKBuilderSpecifies the ECC private key encoded as Base64URL.
- Specified by:
eccPrivateKeyin interfaceECJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Parameters:
d- the Base64URL encoded ECC private key with no padding- Returns:
- this builder
-
resolveFromJWKStore
Description copied from class:AbstractJWKBuilderTries to resolve the JWK from the JWK store.
- Overrides:
resolveFromJWKStorein classAbstractX509JWKBuilder<ECPublicKey,ECPrivateKey, GenericECJWK, GenericECJWKBuilder> - 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<GenericECJWK,GenericECJWKBuilder> - 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<ECPublicKey,ECPrivateKey, GenericECJWK, GenericECJWKBuilder> - 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
-
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 classAbstractX509JWKBuilder<ECPublicKey,ECPrivateKey, GenericECJWK, GenericECJWKBuilder> - 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<GenericECJWK> doBuild() throws JWKBuildException, JWKProcessingExceptionDescription copied from class:AbstractJWKBuilderBuilds the JWK after all checks and processing have terminated successfully.
- Specified by:
doBuildin classAbstractJWKBuilder<GenericECJWK,GenericECJWKBuilder> - Returns:
- a single JWK publisher
- Throws:
JWKBuildException- if there was an error building the JWKJWKProcessingException- if there was a JWK processing error
-