Class JwkEC
java.lang.Object
io.helidon.security.jwt.jwk.Jwk
io.helidon.security.jwt.jwk.JwkEC
Elliptic curve JSON web key.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringECDSA using P-256 and SHA-256.static final StringECDSA using P-384 and SHA-384.static final StringECDSA using "P-521" and SHA-512.static final StringP-256 Curve.static final StringP-384 Curve.static final StringP-521 Curve.static final StringJWK parameter for EC curve.static final StringJWK parameter for private key.static final StringJWK parameter for X coordinate.static final StringJWK parameter for X.509 certificate chain array.static final StringJWK parameter for X.509 certificate chain URL.static final StringJWK parameter for SHA 1 Thumbprint of X.509 certificate.static final StringJWK parameter for SHA 256 Thumbprint of X.509 certificate.static final StringJWK parameter for X coordinate.static final StringThe main Java security algorithm used.Fields inherited from class 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_SIGNATUREModifier and TypeFieldDescriptionstatic final StringAlgorithm defining there is no security (e.g.static final StringKey type of elliptic curve keys.static final StringKey type of octet keys.static final StringKey type of RSA keys.static final JwkA jwk with no fields filled andJwk.ALG_NONEalgorithm.static final StringDecrypt content and validate decryption, if applicable.static final StringDerive bits not to be used as a key.static final StringDerive key.static final StringEncrypt content.static final StringCompute digital signature or MAC.static final StringDecrypt key and validate decryption, if applicable.static final StringVerify digital signature or MAC.static final StringEncrypt key.static final StringJWK parameter for algorithm.static final StringJWK parameter for key id.static final StringJWK parameter for key type.static final StringJWK parameters for permitted operations.static final StringJWK parameter for usage.static final StringKey can be used for encryption only.static final StringKey can be used for signatures only. -
Method Summary
Modifier and TypeMethodDescriptionstatic JwkEC.Builderbuilder()Create a builder instance.X.509 certificate chain.static JwkECcreate(JsonObject json) Create an instance from Json object.byte[]doSign(byte[] bytesToSign) booleandoVerify(byte[] signedBytes, byte[] signatureToVerify) Private key if available.Public key.Optional<byte[]> X.509 certificate SHA-1 thumbprint.Optional<byte[]> X.509 certificate SHA-256 thumbprint.Methods inherited from class Jwk
algorithm, keyId, keyType, operations, sign, toString, usage, verifySignatureModifier and TypeMethodDescriptionThe algorithm used when signing/encrypting this key.keyId()The key id (kid) of this JWK.keyType()The key type (kty) of this JWK.Permitted operations of this JWK.final byte[]sign(byte[] bytesToSign) Sign the bytes to sign using this JWK type and algorithm.toString()usage()Permitted usage of this JWK.final booleanverifySignature(byte[] signedBytes, byte[] signature) Verify that the signature is indeed for the signed bytes based on this JWK type and algorithm.
-
Field Details
-
SECURITY_ALGORITHM
-
ALG_ES256
-
ALG_ES384
-
ALG_ES512
-
CURVE_P256
-
CURVE_P384
-
CURVE_P521
-
PARAM_CURVE
-
PARAM_X_COORDINATE
-
PARAM_Y_COODRINATE
-
PARAM_PRIVATE_KEY
-
PARAM_X509_CHAIN_URL
JWK parameter for X.509 certificate chain URL. See RFC 7517, section 4.6.- See Also:
-
PARAM_X509_CHAIN
JWK parameter for X.509 certificate chain array. See RFC 7517, section 4.7.- See Also:
-
PARAM_X509_SHA_1
JWK parameter for SHA 1 Thumbprint of X.509 certificate. See RFC 7517, section 4.8.- See Also:
-
PARAM_X509_SHA_256
JWK parameter for SHA 256 Thumbprint of X.509 certificate. See RFC 7517, section 4.9.- See Also:
-
-
Method Details
-
builder
Create a builder instance.- Returns:
- builder ready to create a new
JwkECinstance.
-
create
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:
-
doVerify
public boolean doVerify(byte[] signedBytes, byte[] signatureToVerify) -
privateKey
-
publicKey
-
certificateChain
X.509 certificate chain.- Returns:
- certificate chain
-
sha1Thumbprint
X.509 certificate SHA-1 thumbprint.- Returns:
- SHA-1 thumbprint bytes
-
sha256Thumbprint
X.509 certificate SHA-256 thumbprint.- Returns:
- SHA-256 thumbprint bytes
-
doSign
public byte[] doSign(byte[] bytesToSign)
-