Class ClientHelloPreSharedKeyExtension

java.lang.Object
tech.kwik.agent15.extension.PreSharedKeyExtension
tech.kwik.agent15.extension.ClientHelloPreSharedKeyExtension
All Implemented Interfaces:
Extension

public class ClientHelloPreSharedKeyExtension extends PreSharedKeyExtension
TLS Pre-Shared Key Extension, ClientHello variant. see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11
  • Constructor Details

    • ClientHelloPreSharedKeyExtension

      public ClientHelloPreSharedKeyExtension(NewSessionTicket newSessionTicket)
  • Method Details

    • parse

      Parses a pre-shared key extension (ClientHello variant) from a byte stream.
      Parameters:
      buffer -
      Throws:
      DecodeErrorException
    • getBytes

      public byte[] getBytes()
      Description copied from interface: Extension
      Serializes the extension to a byte array, including the extension type and length.
      Returns:
    • calculateBinder

      public void calculateBinder(byte[] clientHello, int pskExtensionStartPosition, byte[] transcriptPrefix, BinderCalculator calculator)
      Computes the binder for the given client hello.
      Parameters:
      clientHello - the serialized client hello
      pskExtensionStartPosition - the position of this extension in the serialized client hello
      transcriptPrefix - the transcript that precedes the client hello; empty for a first client hello, see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11.2
      calculator - computes the binder value
    • getIdentities

    • getBinders

    • getBinderPosition

      public int getBinderPosition()
    • getType

      public int getType()
      Returns:
      the extension type, as defined in https://www.rfc-editor.org/rfc/rfc8446.html#section-4.2