Enum Class JsonWebAlgorithm

java.lang.Object
java.lang.Enum<JsonWebAlgorithm>
uk.co.spudsoft.jwtvalidatorvertx.JsonWebAlgorithm
All Implemented Interfaces:
Serializable, Comparable<JsonWebAlgorithm>, Constable

public enum JsonWebAlgorithm extends Enum<JsonWebAlgorithm>
Algorithm for use with JWTs as specified by RFC7518. https://datatracker.ietf.org/doc/html/rfc7518. Where algorithms are defined in RFC7518 the description for the algorithm is that found there.
Author:
jtalbut
  • Enum Constant Details

    • HS256

      public static final JsonWebAlgorithm HS256
      HMAC using SHA-256.
    • HS384

      public static final JsonWebAlgorithm HS384
      HMAC using SHA-384.
    • HS512

      public static final JsonWebAlgorithm HS512
      HMAC using SHA-512.
    • RS256

      public static final JsonWebAlgorithm RS256
      RSASSA-PKCS-v1_5 using SHA-256.
    • RS384

      public static final JsonWebAlgorithm RS384
      RSASSA-PKCS-v1_5 using SHA-384.
    • RS512

      public static final JsonWebAlgorithm RS512
      RSASSA-PKCS-v1_5 using SHA-512.
    • ES256

      public static final JsonWebAlgorithm ES256
      ECDSA using P-256 and SHA-256.
    • ES384

      public static final JsonWebAlgorithm ES384
      ECDSA using P-384 and SHA-384.
    • ES512

      public static final JsonWebAlgorithm ES512
      ECDSA using P-521 and SHA-512.
    • PS256

      public static final JsonWebAlgorithm PS256
      RSASSA-PSS using SHA-256 and MGF1 with SHA-256.
    • PS384

      public static final JsonWebAlgorithm PS384
      RSASSA-PSS using SHA-384 and MGF1 with SHA-384.
    • PS512

      public static final JsonWebAlgorithm PS512
      RSASSA-PSS using SHA-512 and MGF1 with SHA-512.
    • none

      public static final JsonWebAlgorithm none
      No digital signature or MAC performed.
    • EdDSA

      public static final JsonWebAlgorithm EdDSA
      EdDSA using P-521 and SHA-512.
  • Method Details

    • values

      public static JsonWebAlgorithm[] 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 JsonWebAlgorithm 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
    • getName

      public String getName()
      Get the name of the algorithm, in JWT terminology.
      Returns:
      the name of the algorithm, in JWT terminology.
    • getJdkAlgName

      public String getJdkAlgName()
      Get the name of the algorithm, in JDK terminology.
      Returns:
      the name of the algorithm, in JDK terminology.
    • getFamilyName

      public String getFamilyName()
      Get the name of the family of algorithms that this belongs to.
      Returns:
      the name of the family of algorithms that this belongs to.
    • getMinKeyLength

      public int getMinKeyLength()
      Get the minimum length of keys for this algorithm.
      Returns:
      the minimum length of keys for this algorithm.
    • getSubName

      public String getSubName()
      Get any sub-name that the algorithm may have.
      Returns:
      any sub-name that the algorithm may have.
    • getParameter

      public AlgorithmParameterSpec getParameter()
      Get the parameter spec needed for configuring a signer.
      Returns:
      the parameter spec needed for configuring a signer, may be null.