Enum JweAlgorithm

java.lang.Object
java.lang.Enum<JweAlgorithm>
org.forgerock.json.jose.jwe.JweAlgorithm
All Implemented Interfaces:
Serializable, Comparable<JweAlgorithm>, Algorithm

public enum JweAlgorithm extends Enum<JweAlgorithm> implements Algorithm
An Enum of the possible encryption algorithms that can be used to encrypt a JWT.

Since:
2.0.0
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static JweAlgorithm[] 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 JweAlgorithm 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
    • getAlgorithm

      public String getAlgorithm()
      Description copied from interface: Algorithm
      Gets the actual name of the algorithm that is understood by Java cryptographic operations.
      Specified by:
      getAlgorithm in interface Algorithm
      Returns:
      The name of the algorithm.
    • getJwaAlgorithmName

      Description copied from interface: Algorithm
      Gets the name of the algorithm as defined in the JWA standard.
      Specified by:
      getJwaAlgorithmName in interface Algorithm
      Returns:
      The name of the algorithm.
    • getAlgorithmType

      Gets the JweAlgorithmType of the JweAlgorithm.
      Returns:
      The JweAlgorithmType.
    • parseAlgorithm

      public static JweAlgorithm parseAlgorithm(String algorithm)
      Parses the given algorithm string to find the matching EncryptionMethod enum constant.
      Parameters:
      algorithm - The encryption algorithm.
      Returns:
      The JweAlgorithm enum.
    • toString

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