Enum Class JwkKeyFormat

java.lang.Object
java.lang.Enum<JwkKeyFormat>
org.forgerock.secrets.jwkset.JwkKeyFormat
All Implemented Interfaces:
Serializable, Comparable<JwkKeyFormat>, java.lang.constant.Constable, KeyFormat<JWK>

public enum JwkKeyFormat extends Enum<JwkKeyFormat> implements KeyFormat<JWK>
Exports keys in JSON Web Key (JWK) format.
  • Enum Constant Details

    • USING_USE

      public static final JwkKeyFormat USING_USE
      A JWK format that only includes the use parameter to express the key's usage.
    • USING_KEY_OPS

      public static final JwkKeyFormat USING_KEY_OPS
      A JWK format that only includes the key_ops parameter to express the key's usage.
    • USING_USE_AND_KEY_OPS

      public static final JwkKeyFormat USING_USE_AND_KEY_OPS
      A JWK format that includes both the use and key_ops parameters to express the key's usage.
  • Method Details

    • values

      public static JwkKeyFormat[] 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 JwkKeyFormat 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
    • export

      public JWK export(CryptoKey key, Key rawKey)
      Description copied from interface: KeyFormat
      Exports the given crypto key and raw key material.
      Specified by:
      export in interface KeyFormat<JWK>
      Parameters:
      key - the crypto key.
      rawKey - the raw key material.
      Returns:
      the exported key material in the given format.