Enum MacAlgorithm

java.lang.Object
java.lang.Enum<MacAlgorithm>
com.codename1.backend.security.oauth2.jose.jws.MacAlgorithm
All Implemented Interfaces:
JwsAlgorithm, Comparable<MacAlgorithm>

public enum MacAlgorithm extends Enum<MacAlgorithm> implements JwsAlgorithm
The shared secret algorithms: whoever can verify a token can also make one, so these suit a server checking tokens it issued itself and nothing wider.
  • Enum Constant Details

    • HS256

      public static final MacAlgorithm HS256
      HMAC with SHA-256.
    • HS384

      public static final MacAlgorithm HS384
      HMAC with SHA-384.
    • HS512

      public static final MacAlgorithm HS512
      HMAC with SHA-512.
  • Method Details

    • values

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

      public static MacAlgorithm valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Description copied from interface: JwsAlgorithm
      The name as a token's alg header carries it: RS256.
      Specified by:
      getName in interface JwsAlgorithm
    • from

      public static MacAlgorithm from(String name)
      The algorithm of this name, or null when it is not one of these.