Class ClientHello

java.lang.Object
tech.kwik.agent15.handshake.HandshakeMessage
tech.kwik.agent15.handshake.ClientHello

public class ClientHello extends HandshakeMessage
https://datatracker.ietf.org/doc/html/rfc8446#section-4.1.2
  • Field Details

  • Constructor Details

    • ClientHello

      public ClientHello(String serverName, List<KeyShareExtension.KeyShareEntry> keyShares, boolean compatibilityMode, List<TlsConstants.CipherSuite> supportedCiphers, List<TlsConstants.SignatureScheme> supportedSignatures, List<TlsConstants.NamedGroup> supportedGroups, List<Extension> extraExtensions, BinderCalculator binderCalculator, ClientHello.PskKeyEstablishmentMode pskKeyEstablishmentMode)
      Creates a (first) ClientHello that offers a key share for each of the given groups. https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.8 "Clients MAY send an empty client_shares vector in order to request group selection from the server, at the cost of an additional round trip"; this implementation always sends at least one key share.
      Parameters:
      serverName -
      keyShares - the key shares to offer, in descending order of preference; must not be empty and each of its groups must occur in supportedGroups, in the same order.
      compatibilityMode -
      supportedCiphers -
      supportedSignatures -
      supportedGroups -
      extraExtensions -
      binderCalculator - can be null when no ClientHelloPreSharedKeyExtension is present, must be non-null when ClientHelloPreSharedKeyExtension is present.
      pskKeyEstablishmentMode -
    • ClientHello

      public ClientHello(byte[] clientRandom, byte[] sessionId, List<TlsConstants.CipherSuite> cipherSuites, List<Extension> extensions, BinderCalculator binderCalculator)
      Creates a ClientHello message from its constituent parts. In contrast to the other constructors, this one does not add any extension by itself: the given extensions are serialized as they are, in the order given. This is what makes it possible to create the second ClientHello that must be sent in response to a HelloRetryRequest, which must be identical to the first one except for a limited set of changes, see https://datatracker.ietf.org/doc/html/rfc8446#section-4.1.2.
      Parameters:
      clientRandom - the client random; 32 bytes
      sessionId - the legacy session id; empty when not using compatibility mode
      cipherSuites - the symmetric cipher options supported, in descending order of preference
      extensions - the extensions, in the order in which they must be serialized
      binderCalculator - can be null when no ClientHelloPreSharedKeyExtension is present, must be non-null when ClientHelloPreSharedKeyExtension is present.
    • ClientHello

      public ClientHello(byte[] clientRandom, byte[] sessionId, List<TlsConstants.CipherSuite> cipherSuites, List<Extension> extensions, byte[] transcriptPrefix, BinderCalculator binderCalculator)
      Creates a ClientHello message from its constituent parts, with a transcript prefix for computing the binder of a pre-shared key extension. This is what the second ClientHello (the one sent in response to a HelloRetryRequest) needs, see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11.2.
      Parameters:
      clientRandom - the client random; 32 bytes
      sessionId - the legacy session id; empty when not using compatibility mode
      cipherSuites - the symmetric cipher options supported, in descending order of preference
      extensions - the extensions, in the order in which they must be serialized
      transcriptPrefix - the transcript that precedes this client hello; empty for a first client hello
      binderCalculator - can be null when no ClientHelloPreSharedKeyExtension is present, must be non-null when ClientHelloPreSharedKeyExtension is present.
  • Method Details