Enum Class NamedGroup

java.lang.Object
java.lang.Enum<NamedGroup>
io.github.mahmoudimus.quic.tls.NamedGroup
All Implemented Interfaces:
Serializable, Comparable<NamedGroup>, Constable

public enum NamedGroup extends Enum<NamedGroup>
The groups the handshake offers and accepts for key exchange (RFC 8446 section 4.2.7): (EC)DHE groups and the X25519MLKEM768 hybrid.
  • Enum Constant Details

    • X25519

      public static final NamedGroup X25519
      X25519 (RFC 7748).
    • SECP256R1

      public static final NamedGroup SECP256R1
      NIST P-256, secp256r1.
    • SECP384R1

      public static final NamedGroup SECP384R1
      NIST P-384, secp384r1.
    • SECP521R1

      public static final NamedGroup SECP521R1
      NIST P-521, secp521r1.
    • X25519_MLKEM768

      public static final NamedGroup X25519_MLKEM768
      X25519MLKEM768 (draft-ietf-tls-ecdhe-mlkem), the post-quantum hybrid browsers offer first: a key encapsulation, so the client's share (an ML-KEM-768 encapsulation key and an X25519 key, 1216 bytes) and the server's (a ciphertext and an X25519 key, 1120 bytes) differ.
  • Method Details

    • values

      public static NamedGroup[] 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 NamedGroup 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
    • code

      public int code()
      The group's TLS code point.
      Returns:
      the two-byte code, such as 0x001d for X25519
    • forCode

      public static NamedGroup forCode(int code)
      The group with a TLS code point.
      Parameters:
      code - the code point
      Returns:
      the group, or null if it is not one of these