java.lang.Object
io.helidon.security.jwt.jwk.Jwk
io.helidon.security.jwt.jwk.JwkOctet
Symmetric cipher JSON web key.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
HMAC using SHA-256.static final String
HMAC using SHA-384.static final String
HMAC using SHA-512.static final String
Key value.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
Modifier and TypeMethodDescriptionstatic JwkOctet.Builder
builder()
Create a builder instance.static JwkOctet
create
(JsonObject json) Create an instance from Json object.byte[]
doSign
(byte[] bytesToSign) boolean
doVerify
(byte[] signedBytes, byte[] signature) byte[]
Get the bytes of the secret key.Methods inherited from class io.helidon.security.jwt.jwk.Jwk
algorithm, keyId, keyType, operations, sign, toString, usage, verifySignature
-
Field Details
-
ALG_HS256
HMAC using SHA-256. See RFC 7518, section 7.1.2.- See Also:
-
ALG_HS384
HMAC using SHA-384. See RFC 7518, section 7.1.2.- See Also:
-
ALG_HS512
HMAC using SHA-512. See RFC 7518, section 7.1.2.- See Also:
-
PARAM_OCTET_KEY
Key value. The "k" (key value) parameter contains the value of the symmetric (or other single-valued) key. It is represented as the base64url encoding of the octet sequence containing the key value. See RFC 7518, section 6.4.1.- See Also:
-
-
Method Details
-
builder
Create a builder instance.- Returns:
- builder ready to create a new
JwkOctet
instance.
-
create
Create an instance from Json object. Note that the"k"
must be base64 encoded.- Parameters:
json
- with definition of this octet web key- Returns:
- new instance of this class constructed from json
- See Also:
-
getKeyBytes
public byte[] getKeyBytes()Get the bytes of the secret key.- Returns:
- byte array of the secret key
-
doVerify
public boolean doVerify(byte[] signedBytes, byte[] signature) -
doSign
public byte[] doSign(byte[] bytesToSign)
-