com.nimbusds.jose.jwk
public static class ECKey.Builder extends Object
Example use:
ECKey key = new ECKey.Builder(Curve.P521, x, y). setD(d). setAlgorithm(JWSAlgorithm.ES512). setKeyID("789"). build();
Constructor and Description |
---|
ECKey.Builder(ECKey.Curve crv,
Base64URL x,
Base64URL y)
Creates a new Elliptic Curve JWK builder.
|
ECKey.Builder(ECKey.Curve crv,
ECPublicKey pub)
Creates a new Elliptic Curve JWK builder.
|
Modifier and Type | Method and Description |
---|---|
ECKey |
build()
Builds a new octet sequence JWK.
|
ECKey.Builder |
setAlgorithm(Algorithm alg)
Sets the intended JOSE algorithm (
alg ) for the JWK. |
ECKey.Builder |
setD(Base64URL d)
Sets the private 'd' coordinate for the elliptic curve
point.
|
ECKey.Builder |
setKeyID(String kid)
Sets the ID (
kid ) of the JWK. |
ECKey.Builder |
setKeyUse(Use use)
Sets the use (
use ) of the JWK. |
ECKey.Builder |
setPrivateKey(ECPrivateKey priv)
Sets the private Elliptic Curve key.
|
ECKey.Builder |
setX509CertChain(List<Base64> x5c)
Sets the X.509 certificate chain (
x5c ) of the JWK. |
ECKey.Builder |
setX509CertThumbprint(Base64URL x5t)
Sets the X.509 certificate thumbprint (
x5t ) of the
JWK. |
ECKey.Builder |
setX509CertURL(URL x5u)
Sets the X.509 certificate URL (
x5u ) of the JWK. |
public ECKey.Builder(ECKey.Curve crv, Base64URL x, Base64URL y)
crv
- The cryptographic curve. Must not be
null
.x
- The public 'x' coordinate for the elliptic curve
point. It is represented as the Base64URL
encoding of the coordinate's big endian
representation. Must not be null
.y
- The public 'y' coordinate for the elliptic curve
point. It is represented as the Base64URL
encoding of the coordinate's big endian
representation. Must not be null
.public ECKey.Builder(ECKey.Curve crv, ECPublicKey pub)
crv
- The cryptographic curve. Must not be
null
.pub
- The public EC key to represent. Must not be
null
.public ECKey.Builder setD(Base64URL d)
setPrivateKey(java.security.interfaces.ECPrivateKey)
.d
- The 'd' coordinate. It is represented as the
Base64URL encoding of the coordinate's big endian
representation. null
if not specified (for
a public key).public ECKey.Builder setPrivateKey(ECPrivateKey priv)
setD(com.nimbusds.jose.util.Base64URL)
.priv
- The private EC key, used to obtain the private
'd' coordinate for the elliptic curve point.
null
if not specified (for a public
key).public ECKey.Builder setKeyUse(Use use)
use
) of the JWK.use
- The key use, null
if not specified or if
the key is intended for signing as well as
encryption.public ECKey.Builder setAlgorithm(Algorithm alg)
alg
) for the JWK.alg
- The intended JOSE algorithm, null
if not
specified.public ECKey.Builder setKeyID(String kid)
kid
) of the JWK. The key ID can be used
to match a specific key. This can be used, for instance, to
choose a key within a JWKSet
during key rollover.
The key ID may also correspond to a JWS/JWE kid
header parameter value.kid
- The key ID, null
if not specified.public ECKey.Builder setX509CertURL(URL x5u)
x5u
) of the JWK.x5u
- The X.509 certificate URL, null
if not
specified.public ECKey.Builder setX509CertThumbprint(Base64URL x5t)
x5t
) of the
JWK.x5t
- The X.509 certificate thumbprint, null
if
not specified.public ECKey.Builder setX509CertChain(List<Base64> x5c)
x5c
) of the JWK.x5c
- The X.509 certificate chain as a unmodifiable
list, null
if not specified.Copyright © 2013 NimbusDS. All Rights Reserved.