Enum Class JwsAlgorithmType

java.lang.Object
java.lang.Enum<JwsAlgorithmType>
org.forgerock.json.jose.jws.JwsAlgorithmType
All Implemented Interfaces:
Serializable, Comparable<JwsAlgorithmType>, Constable

public enum JwsAlgorithmType extends Enum<JwsAlgorithmType>
An Enum of the possible types of JWS algorithms that can be used to sign a JWT.
Since:
2.0.0
See Also:
  • Enum Constant Details

    • NONE

      @Deprecated public static final JwsAlgorithmType NONE
      Deprecated.
      This algorithm is inherently insecure and shouldn't be used.
      No digital signature or MAC value included.
    • HMAC

      public static final JwsAlgorithmType HMAC
      HMAC signing algorithm.
    • RSA

      public static final JwsAlgorithmType RSA
      RSA signing algorithm.
    • ECDSA

      public static final JwsAlgorithmType ECDSA
      Elliptic Curve DSA signing algorithm.
    • EDDSA

      public static final JwsAlgorithmType EDDSA
      Edwards Curve DSA signing algorithm. See RFC 8037.
  • Method Details

    • values

      public static JwsAlgorithmType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JwsAlgorithmType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSymmetric

      public boolean isSymmetric()
      Indicates whether the algorithm type is a symmetric (secret key) algorithm like HMAC or a public key algorithm. Note: the special value NONE is treated as a symmetric algorithm by this method, but it doesn't use a key at all.
      Returns:
      true if the algorithm type uses a shared secret key for signing and verification or false if it uses distinct private and public keys for these operations.
    • toString

      public String toString()
      Turns the JwsAlgorithmType constant into a JSON value string.
      Overrides:
      toString in class Enum<JwsAlgorithmType>
      Returns: