Module io.inverno.mod.security.jose
Class AbstractOKPJWKBuilder<A extends PublicKey,B extends PrivateKey,C extends OKPJWK<A,B>,D extends AbstractOKPJWKBuilder<A,B,C,D>>
java.lang.Object
io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder<C,D>
io.inverno.mod.security.jose.internal.jwk.AbstractX509JWKBuilder<A,B,C,D>
io.inverno.mod.security.jose.internal.jwk.okp.AbstractOKPJWKBuilder<A,B,C,D>
- Type Parameters:
A- the public key typeB- the private key typeC- the Octet Key Pair JWK typeD- the Octet Key Pair JWK builder type
- All Implemented Interfaces:
JWKBuilder<C,,D> OKPJWKBuilder<A,,B, C, D> X509JWKBuilder<A,,B, C, D> Cloneable
- Direct Known Subclasses:
GenericEdECJWKBuilder,GenericXECJWKBuilder
public abstract class AbstractOKPJWKBuilder<A extends PublicKey,B extends PrivateKey,C extends OKPJWK<A,B>,D extends AbstractOKPJWKBuilder<A,B,C,D>>
extends AbstractX509JWKBuilder<A,B,C,D>
implements OKPJWKBuilder<A,B,C,D>
Base Octet Key Pair JWON Web Key builder implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OKPCurveThe Curve parameter as defined by RFC8037 Section 3.protected StringThe private key parameter as defined by RFC8037 Section 3.protected StringThe public key parameter as defined by RFC8037 Section 3.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
ConstructorsConstructorDescriptionAbstractOKPJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic OKP JWK builder.AbstractOKPJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) Creates a generic OKP JWK builder initialized with the specified parameters map. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the Elliptic curve JWA name.privateKey(String d) Specifies the private key encoded as Base64URL.Specifies the public key 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 voidSets the specified parameter into the builder.Methods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractX509JWKBuilder
resolveCertificate, x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURLMethods inherited from class io.inverno.mod.security.jose.internal.jwk.AbstractJWKBuilder
algorithm, build, doBuild, keyId, keyOperations, publicKeyUse, resolveKeyMethods 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.X509JWKBuilder
x509CertificateChain, x509CertificateSHA1Thumbprint, x509CertificateSHA256Thumbprint, x509CertificateURL
-
Field Details
-
curve
The Curve parameter as defined by RFC8037 Section 3. -
x
The public key parameter as defined by RFC8037 Section 3. -
d
The private key parameter as defined by RFC8037 Section 3.
-
-
Constructor Details
-
AbstractOKPJWKBuilder
public AbstractOKPJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator) Creates a generic OKP 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
-
AbstractOKPJWKBuilder
public AbstractOKPJWKBuilder(JOSEConfiguration configuration, JWKStore jwkStore, JWKKeyResolver keyResolver, JWKURLResolver urlResolver, X509JWKCertPathValidator certPathValidator, Map<String, Object> parameters) throws JWKReadExceptionCreates a generic OKP 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<A extends PublicKey,B extends PrivateKey, C extends OKPJWK<A, B>, D extends AbstractOKPJWKBuilder<A, B, C, D>> - Parameters:
field- the parameter namevalue- the parameter value- Throws:
JWKReadException- if there was an error reading the value
-
curve
Description copied from interface:OKPJWKBuilderSpecifies the Elliptic curve JWA name.
-
publicKey
Description copied from interface:OKPJWKBuilderSpecifies the public key encoded as Base64URL.
-
privateKey
Description copied from interface:OKPJWKBuilderSpecifies the private key encoded as Base64URL.
- Specified by:
privateKeyin interfaceOKPJWKBuilder<A extends PublicKey,B extends PrivateKey, C extends OKPJWK<A, B>, D extends AbstractOKPJWKBuilder<A, B, C, D>> - Parameters:
d- the Base64URL encoded 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<A extends PublicKey,B extends PrivateKey, C extends OKPJWK<A, B>, D extends AbstractOKPJWKBuilder<A, B, C, D>> - 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 classAbstractX509JWKBuilder<A extends PublicKey,B extends PrivateKey, C extends OKPJWK<A, B>, D extends AbstractOKPJWKBuilder<A, B, C, D>> - 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
-