Record Class ExtensionSpec

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.ExtensionSpec
Record Components:
type - the extension type, or GREASE_FIRST or GREASE_LAST for the hello's two GREASE extensions
body - makes the body
keyShareGroups - for key_share, the groups it carries shares for (GREASE as ProfileExtensions.GREASE), so a client can make the keys first; null otherwise
pinned - whether shuffling leaves it where it is, as NSS leaves the extensions it adds after its own (QUIC's transport parameters, ECH)

public record ExtensionSpec(int type, ExtensionSpec.Body body, int[] keyShareGroups, boolean pinned) extends Record
One extension of a ClientHelloProfile: its type, and how its body is made for a connection.
  • Field Details

  • Constructor Details

    • ExtensionSpec

      public ExtensionSpec(int type, ExtensionSpec.Body body, int[] keyShareGroups)
      An extension that shuffling may move.
    • ExtensionSpec

      public ExtensionSpec(int type, ExtensionSpec.Body body)
      An extension that is not key_share.
    • ExtensionSpec

      public ExtensionSpec(int type, ExtensionSpec.Body body, int[] keyShareGroups, boolean pinned)
      Creates an instance of a ExtensionSpec record class.
      Parameters:
      type - the value for the type record component
      body - the value for the body record component
      keyShareGroups - the value for the keyShareGroups record component
      pinned - the value for the pinned record component
  • Method Details

    • pin

      public ExtensionSpec pin()
      Returns this extension, in a place that shuffling does not change.
      Returns:
      this extension, in a place that shuffling does not change
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public int type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • body

      public ExtensionSpec.Body body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • keyShareGroups

      public int[] keyShareGroups()
      Returns the value of the keyShareGroups record component.
      Returns:
      the value of the keyShareGroups record component
    • pinned

      public boolean pinned()
      Returns the value of the pinned record component.
      Returns:
      the value of the pinned record component