Record Class HelloContext

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.tls.HelloContext
Record Components:
serverName - the SNI host name, or null to send none
alpnProtocols - the ALPN protocols, in preference order; empty to send no ALPN
keyShares - each key share's public key, by named group code, as the share carries it
grease - the hello's GREASE values
random - the source of the hello's random bytes; a SecureRandom on a real connection
supplied - extension bodies the connection makes itself, by type, such as QUIC's quic_transport_parameters, for ProfileExtensions.supplied(int)
pskLength - the length of the pre_shared_key body the client adds after the profile's extensions when it resumes a session, 0 when it does not: what a browser that treats a resumption differently (Firefox leaves out session_ticket, and sizes its GREASE ECH with the PSK) needs to know

public record HelloContext(String serverName, List<String> alpnProtocols, Map<Integer,byte[]> keyShares, Grease grease, RandomGenerator random, Map<Integer,byte[]> supplied, int pskLength) extends Record
What one ClientHello says that its profile does not: the server's name, the ALPN protocols offered on this connection, the public keys of the key shares, the GREASE values, and where the random bytes (client random, session id, GREASE ECH, shuffling) come from.
  • Constructor Details

  • Method Details

    • resuming

      public boolean resuming()
      Returns whether the hello resumes a session with a PSK.
      Returns:
      whether the hello resumes a session with a PSK
    • 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.
    • serverName

      public String serverName()
      Returns the value of the serverName record component.
      Returns:
      the value of the serverName record component
    • alpnProtocols

      public List<String> alpnProtocols()
      Returns the value of the alpnProtocols record component.
      Returns:
      the value of the alpnProtocols record component
    • keyShares

      public Map<Integer,byte[]> keyShares()
      Returns the value of the keyShares record component.
      Returns:
      the value of the keyShares record component
    • grease

      public Grease grease()
      Returns the value of the grease record component.
      Returns:
      the value of the grease record component
    • random

      public RandomGenerator random()
      Returns the value of the random record component.
      Returns:
      the value of the random record component
    • supplied

      public Map<Integer,byte[]> supplied()
      Returns the value of the supplied record component.
      Returns:
      the value of the supplied record component
    • pskLength

      public int pskLength()
      Returns the value of the pskLength record component.
      Returns:
      the value of the pskLength record component