Class TlsState

java.lang.Object
tech.kwik.agent15.engine.impl.TlsState
All Implemented Interfaces:
BinderCalculator

public class TlsState extends Object implements BinderCalculator
  • Constructor Details

    • TlsState

      public TlsState(TranscriptHash transcriptHash, byte[] psk, int keyLength, int hashLength)
    • TlsState

      public TlsState(TranscriptHash transcriptHash, int keyLength, int hashLength)
  • Method Details

    • computePskBinder

      public byte[] computePskBinder(byte[] transcriptPrefix, byte[] partialClientHello)
      Description copied from interface: BinderCalculator
      Computes the binder for a client hello that is preceded by other handshake messages. https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11.2 "If the server responds with a HelloRetryRequest and the client then sends ClientHello2, its binder will be computed over: Transcript-Hash(ClientHello1, HelloRetryRequest, Truncate(ClientHello2))"
      Specified by:
      computePskBinder in interface BinderCalculator
      Parameters:
      transcriptPrefix - the transcript that precedes the client hello (empty for a first client hello); for a second client hello, this is the synthetic message that replaces the first client hello followed by the hello retry request
      partialClientHello - the client hello up to (not including) the binders list
    • computeEarlyTrafficSecret

      public void computeEarlyTrafficSecret()
    • computeHandshakeSecrets

      public void computeHandshakeSecrets()
    • computeApplicationSecrets

      public void computeApplicationSecrets()
    • computeResumptionMasterSecret

      public void computeResumptionMasterSecret()
    • computePSK

      public byte[] computePSK(byte[] ticketNonce)
    • hkdfExpandLabel

      public byte[] hkdfExpandLabel(byte[] secret, String label, String context, short length)
    • getHashLength

      public short getHashLength()
    • getClientEarlyTrafficSecret

      public byte[] getClientEarlyTrafficSecret()
    • getClientHandshakeTrafficSecret

      public byte[] getClientHandshakeTrafficSecret()
    • getServerHandshakeTrafficSecret

      public byte[] getServerHandshakeTrafficSecret()
    • getClientApplicationTrafficSecret

      public byte[] getClientApplicationTrafficSecret()
    • getServerApplicationTrafficSecret

      public byte[] getServerApplicationTrafficSecret()
    • setSharedSecret

      public void setSharedSecret(byte[] secret)
    • setPskSelected

      public void setPskSelected(int selectedIdentity) throws IllegalParameterAlert
      Throws:
      IllegalParameterAlert
    • setNoPskSelected

      public void setNoPskSelected()