Enum Class JwsAlgorithm

java.lang.Object
java.lang.Enum<JwsAlgorithm>
com.jsgalactic.axiom.security.jwt.JwsAlgorithm
All Implemented Interfaces:
Serializable, Comparable<JwsAlgorithm>, Constable

public enum JwsAlgorithm extends Enum<JwsAlgorithm>
The JWS signature algorithms JwtAuthenticator can verify, all implemented by the JDK. none is deliberately absent: an unsigned token is never accepted. A token's alg header must name one of these and match the algorithm its verification key was registered for.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    EdDSA (RFC 8037) on Ed25519 only; Ed448 keys and signatures are refused.
    ECDSA on P-256 with SHA-256.
    ECDSA on P-384 with SHA-384.
    ECDSA on P-521 with SHA-512.
    HMAC with SHA-256; a secret of at least 32 bytes.
    HMAC with SHA-384; a secret of at least 48 bytes.
    HMAC with SHA-512; a secret of at least 64 bytes.
    RSASSA-PSS with SHA-256, MGF1 with SHA-256 and a 32-byte salt; an RSA public key of at least 2048 bits.
    RSASSA-PSS with SHA-384, MGF1 with SHA-384 and a 48-byte salt; an RSA public key of at least 2048 bits.
    RSASSA-PSS with SHA-512, MGF1 with SHA-512 and a 64-byte salt; an RSA public key of at least 2048 bits.
    RSASSA-PKCS1-v1_5 with SHA-256; an RSA public key of at least 2048 bits.
    RSASSA-PKCS1-v1_5 with SHA-384; an RSA public key of at least 2048 bits.
    RSASSA-PKCS1-v1_5 with SHA-512; an RSA public key of at least 2048 bits.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static JwsAlgorithm[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • HS256

      public static final JwsAlgorithm HS256
      HMAC with SHA-256; a secret of at least 32 bytes.
    • HS384

      public static final JwsAlgorithm HS384
      HMAC with SHA-384; a secret of at least 48 bytes.
    • HS512

      public static final JwsAlgorithm HS512
      HMAC with SHA-512; a secret of at least 64 bytes.
    • RS256

      public static final JwsAlgorithm RS256
      RSASSA-PKCS1-v1_5 with SHA-256; an RSA public key of at least 2048 bits.
    • RS384

      public static final JwsAlgorithm RS384
      RSASSA-PKCS1-v1_5 with SHA-384; an RSA public key of at least 2048 bits.
    • RS512

      public static final JwsAlgorithm RS512
      RSASSA-PKCS1-v1_5 with SHA-512; an RSA public key of at least 2048 bits.
    • PS256

      public static final JwsAlgorithm PS256
      RSASSA-PSS with SHA-256, MGF1 with SHA-256 and a 32-byte salt; an RSA public key of at least 2048 bits.
    • PS384

      public static final JwsAlgorithm PS384
      RSASSA-PSS with SHA-384, MGF1 with SHA-384 and a 48-byte salt; an RSA public key of at least 2048 bits.
    • PS512

      public static final JwsAlgorithm PS512
      RSASSA-PSS with SHA-512, MGF1 with SHA-512 and a 64-byte salt; an RSA public key of at least 2048 bits.
    • ES256

      public static final JwsAlgorithm ES256
      ECDSA on P-256 with SHA-256.
    • ES384

      public static final JwsAlgorithm ES384
      ECDSA on P-384 with SHA-384.
    • ES512

      public static final JwsAlgorithm ES512
      ECDSA on P-521 with SHA-512.
    • EdDSA

      public static final JwsAlgorithm EdDSA
      EdDSA (RFC 8037) on Ed25519 only; Ed448 keys and signatures are refused.
  • Method Details

    • values

      public static JwsAlgorithm[] 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 JwsAlgorithm 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