- java.lang.Object
-
- io.helidon.security.jwt.jwk.Jwk
-
- io.helidon.security.jwt.jwk.JwkEC
-
public class JwkEC extends Jwk
Elliptic curve JSON web key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJwkEC.BuilderBuilder forJwkEC.
-
Field Summary
Fields Modifier and Type Field Description static StringALG_ES256ECDSA using P-256 and SHA-256.static StringALG_ES384ECDSA using P-384 and SHA-384.static StringALG_ES512ECDSA using "P-521" and SHA-512.static StringCURVE_P256P-256 Curve.static StringCURVE_P384P-384 Curve.static StringCURVE_P521P-521 Curve.static StringPARAM_CURVEJWK parameter for EC curve.static StringPARAM_PRIVATE_KEYJWK parameter for private key.static StringPARAM_X_COORDINATEJWK parameter for X coordinate.static StringPARAM_X509_CHAINJWK parameter for X.509 certificate chain array.static StringPARAM_X509_CHAIN_URLJWK parameter for X.509 certificate chain URL.static StringPARAM_X509_SHA_1JWK parameter for SHA 1 Thumbprint of X.509 certificate.static StringPARAM_X509_SHA_256JWK parameter for SHA 256 Thumbprint of X.509 certificate.static StringPARAM_Y_COODRINATEJWK parameter for X coordinate.static StringSECURITY_ALGORITHMThe main Java security algorithm used.-
Fields inherited from class io.helidon.security.jwt.jwk.Jwk
ALG_NONE, KEY_TYPE_EC, KEY_TYPE_OCT, KEY_TYPE_RSA, NONE_JWK, OPERATION_DECRYPT, OPERATION_DERIVE_BITS, OPERATION_DERIVE_KEY, OPERATION_ENCRYPT, OPERATION_SIGN, OPERATION_UNWRAP_KEY, OPERATION_VERIFY, OPERATION_WRAP_KEY, PARAM_ALGORITHM, PARAM_KEY_ID, PARAM_KEY_TYPE, PARAM_OPERATIONS, PARAM_USE, USE_ENCRYPTION, USE_SIGNATURE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JwkEC.Builderbuilder()Create a builder instance.Optional<List<X509Certificate>>certificateChain()static JwkECcreate(JsonObject json)Create an instance from Json object.byte[]doSign(byte[] bytesToSign)booleandoVerify(byte[] signedBytes, byte[] signatureToVerify)Optional<PrivateKey>privateKey()PublicKeypublicKey()Optional<byte[]>sha1Thumbprint()Optional<byte[]>sha256Thumbprint()-
Methods inherited from class io.helidon.security.jwt.jwk.Jwk
algorithm, keyId, keyType, operations, sign, toString, usage, verifySignature
-
-
-
-
Field Detail
-
SECURITY_ALGORITHM
public static final String SECURITY_ALGORITHM
The main Java security algorithm used.- See Also:
- Constant Field Values
-
ALG_ES256
public static final String ALG_ES256
ECDSA using P-256 and SHA-256. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_ES384
public static final String ALG_ES384
ECDSA using P-384 and SHA-384. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_ES512
public static final String ALG_ES512
- See Also:
- Constant Field Values
-
CURVE_P256
public static final String CURVE_P256
P-256 Curve. See RFC 7518, section 7.6.2.- See Also:
- Constant Field Values
-
CURVE_P384
public static final String CURVE_P384
P-384 Curve. See RFC 7518, section 7.6.2.- See Also:
- Constant Field Values
-
CURVE_P521
public static final String CURVE_P521
P-521 Curve. See RFC 7518, section 7.6.2.- See Also:
- Constant Field Values
-
PARAM_CURVE
public static final String PARAM_CURVE
JWK parameter for EC curve. See RFC 7518, section 6.2.1.1.- See Also:
CURVE_P256,CURVE_P384,CURVE_P521, Constant Field Values
-
PARAM_X_COORDINATE
public static final String PARAM_X_COORDINATE
JWK parameter for X coordinate. See RFC 7518, section 6.2.1.2.- See Also:
- Constant Field Values
-
PARAM_Y_COODRINATE
public static final String PARAM_Y_COODRINATE
JWK parameter for X coordinate. See RFC 7518, section 6.2.1.3.- See Also:
- Constant Field Values
-
PARAM_PRIVATE_KEY
public static final String PARAM_PRIVATE_KEY
JWK parameter for private key. See RFC 7518, section 6.2.2.1.- See Also:
- Constant Field Values
-
PARAM_X509_CHAIN_URL
public static final String PARAM_X509_CHAIN_URL
JWK parameter for X.509 certificate chain URL. See RFC 7517, section 4.6.- See Also:
- Constant Field Values
-
PARAM_X509_CHAIN
public static final String PARAM_X509_CHAIN
JWK parameter for X.509 certificate chain array. See RFC 7517, section 4.7.- See Also:
- Constant Field Values
-
PARAM_X509_SHA_1
public static final String PARAM_X509_SHA_1
JWK parameter for SHA 1 Thumbprint of X.509 certificate. See RFC 7517, section 4.8.- See Also:
- Constant Field Values
-
PARAM_X509_SHA_256
public static final String PARAM_X509_SHA_256
JWK parameter for SHA 256 Thumbprint of X.509 certificate. See RFC 7517, section 4.9.- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static JwkEC.Builder builder()
Create a builder instance.- Returns:
- builder ready to create a new
JwkECinstance.
-
create
public static JwkEC create(JsonObject json)
Create an instance from Json object.- Parameters:
json- with definition of this EC web key- Returns:
- new instance of this class constructed from json
- See Also:
for generic method that can load any supported JWK type.
-
doVerify
public boolean doVerify(byte[] signedBytes, byte[] signatureToVerify)
-
privateKey
public Optional<PrivateKey> privateKey()
-
publicKey
public PublicKey publicKey()
-
certificateChain
public Optional<List<X509Certificate>> certificateChain()
-
sha1Thumbprint
public Optional<byte[]> sha1Thumbprint()
-
sha256Thumbprint
public Optional<byte[]> sha256Thumbprint()
-
doSign
public byte[] doSign(byte[] bytesToSign)
-
-