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.
  • Field Details

    • ALG_HS256

      public static final String ALG_HS256
      HMAC using SHA-256. See RFC 7518, section 7.1.2.
      See Also:
    • ALG_HS384

      public static final String ALG_HS384
      HMAC using SHA-384. See RFC 7518, section 7.1.2.
      See Also:
    • ALG_HS512

      public static final String ALG_HS512
      HMAC using SHA-512. See RFC 7518, section 7.1.2.
      See Also:
    • 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:
  • Method Details

    • 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. 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)