Package org.forgerock.json.jose.jwk
Class OkpJWK.Builder
- java.lang.Object
-
- org.forgerock.json.jose.jwk.JWK.Builder<OkpJWK.Builder>
-
- org.forgerock.json.jose.jwk.OkpJWK.Builder
-
- Enclosing class:
- OkpJWK
public static class OkpJWK.Builder extends JWK.Builder<OkpJWK.Builder>
Builder object for Octet Key-Pair (OKP) JWKs.
-
-
Field Summary
-
Fields inherited from class org.forgerock.json.jose.jwk.JWK.Builder
algorithm, keyId, keyOperations, keyType, use, x509Chain, x509Thumbnail, x509url
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OkpJWKbuild()Builds the JWK.OkpJWK.Buildercurve(SupportedEllipticCurve curve)Sets the elliptic curve that this key uses.OkpJWK.Builderd(String d)Sets the private key d-value of the key.OkpJWK.BuilderkeyPair(KeyPair keyPair)Sets the public and private values from the given key pair.OkpJWK.BuilderprivateKey(PrivateKey privateKey)Sets the private key d-value from the given private key.OkpJWK.BuilderpublicKey(PublicKey publicKey)Sets the public x-coordinate from the given public key.OkpJWK.Builderx(String x)Sets the public key x-coordinate of the key.OkpJWK.BuilderxecPrivateKey(PrivateKey xecPrivateKey)Sets the private scalar value from the given XECPrivateKey (Java 11+).OkpJWK.BuilderxecPublicKey(PublicKey xecPublicKey)Sets the public x-coordinate from the given XECPublicKey (Java 11+).-
Methods inherited from class org.forgerock.json.jose.jwk.JWK.Builder
algorithm, algorithm, keyId, keyOperations, keyUse, withX509Thumbprint, withX509ThumbprintS256, x509Chain, x509Thumbnail, x509Thumbprint, x509ThumbprintS256, x509Url
-
-
-
-
Method Detail
-
curve
public OkpJWK.Builder curve(SupportedEllipticCurve curve)
Sets the elliptic curve that this key uses. Must be one of the supported EdDSA or X25519/X448 curves defined in RFC 8037.- Parameters:
curve- the supported elliptic curve.- Returns:
- this builder object.
-
x
public OkpJWK.Builder x(String x)
Sets the public key x-coordinate of the key.- Parameters:
x- the x-coordinate of the key.- Returns:
- this builder object.
-
d
public OkpJWK.Builder d(String d)
Sets the private key d-value of the key.- Parameters:
d- the private key value.- Returns:
- this builder object.
-
privateKey
public OkpJWK.Builder privateKey(PrivateKey privateKey)
Sets the private key d-value from the given private key.- Parameters:
privateKey- the private key.- Returns:
- this builder object.
-
publicKey
public OkpJWK.Builder publicKey(PublicKey publicKey)
Sets the public x-coordinate from the given public key.- Parameters:
publicKey- the public key. Must either be a XECPublicKey or OctetECPublicKey- Returns:
- this builder object.
-
xecPublicKey
public OkpJWK.Builder xecPublicKey(PublicKey xecPublicKey)
Sets the public x-coordinate from the given XECPublicKey (Java 11+).- Parameters:
xecPublicKey- the XECPublicKey.- Returns:
- this builder object.
-
xecPrivateKey
public OkpJWK.Builder xecPrivateKey(PrivateKey xecPrivateKey)
Sets the private scalar value from the given XECPrivateKey (Java 11+).- Parameters:
xecPrivateKey- the XECPrivateKey.- Returns:
- this builder object.
-
keyPair
public OkpJWK.Builder keyPair(KeyPair keyPair)
Sets the public and private values from the given key pair.- Parameters:
keyPair- the key pair- Returns:
- this builder object.
-
build
public OkpJWK build()
Description copied from class:JWK.BuilderBuilds the JWK.- Specified by:
buildin classJWK.Builder<OkpJWK.Builder>- Returns:
- the JWK.
-
-