Enum Class OKPCurve

java.lang.Object
java.lang.Enum<OKPCurve>
io.inverno.mod.security.jose.jwa.OKPCurve
All Implemented Interfaces:
Serializable, Comparable<OKPCurve>, Constable

public enum OKPCurve extends Enum<OKPCurve>

Octet Key Pair Elliptic curves as defined by RFC8037

Supported curves:

  • Ed25519
  • Ed448
  • X25519
  • X448

These curves are used in conjuntion with algorithms defined by EdECAlgorithm and XECAlgorithm.

Since:
1.5
Author:
Jeremy Kuhn
  • Enum Constant Details

  • Method Details

    • values

      public static OKPCurve[] 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 OKPCurve 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
    • getCurve

      public String getCurve()

      Returns the JWA registered curve name.

      Returns:
      the registered name of the curve
    • getJCAName

      public String getJCAName()

      Returns the JCA curve name.

      Returns:
      the JCA curve name
    • getKeyLength

      public int getKeyLength()

      Returns the key length in bytes.

      Returns:
      the key length in bytes
    • fromCurve

      public static OKPCurve fromCurve(String crv)

      Returns the curve corresponding to the specified JWA registered curve name.

      Parameters:
      crv - a JWA registered curve name
      Returns:
      an OKP curve
      Throws:
      IllegalArgumentException - if the specified curve is not supported