Package io.helidon.security.jwt.jwk
Class JwkOctet
- java.lang.Object
-
- io.helidon.security.jwt.jwk.Jwk
-
- io.helidon.security.jwt.jwk.JwkOctet
-
public class JwkOctet extends Jwk
Symmetric cipher JSON web key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JwkOctet.Builder
Builder forJwkOctet
.
-
Field Summary
Fields Modifier and Type Field Description static String
ALG_HS256
HMAC using SHA-256.static String
ALG_HS384
HMAC using SHA-384.static String
ALG_HS512
HMAC using SHA-512.static String
PARAM_OCTET_KEY
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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[]
getKeyBytes()
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 Detail
-
ALG_HS256
public static final String ALG_HS256
HMAC using SHA-256. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_HS384
public static final String ALG_HS384
HMAC using SHA-384. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
ALG_HS512
public static final String ALG_HS512
HMAC using SHA-512. See RFC 7518, section 7.1.2.- See Also:
- Constant Field Values
-
PARAM_OCTET_KEY
public static final String 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:
- Constant Field Values
-
-
Method Detail
-
builder
public static JwkOctet.Builder builder()
Create a builder instance.- Returns:
- builder ready to create a new
JwkOctet
instance.
-
create
public static JwkOctet create(JsonObject json)
Create an instance from Json object.- Parameters:
json
- with definition of this octet web key- Returns:
- new instance of this class constructed from json
- See Also:
for generic method that can load any supported JWK type.
-
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)
-
-