Class ClientHelloPreSharedKeyExtension
java.lang.Object
tech.kwik.agent15.extension.PreSharedKeyExtension
tech.kwik.agent15.extension.ClientHelloPreSharedKeyExtension
- All Implemented Interfaces:
Extension
TLS Pre-Shared Key Extension, ClientHello variant.
see https://datatracker.ietf.org/doc/html/rfc8446#section-4.2.11
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateBinder(byte[] clientHello, int pskExtensionStartPosition, byte[] transcriptPrefix, BinderCalculator calculator) Computes the binder for the given client hello.intbyte[]getBytes()Serializes the extension to a byte array, including the extension type and length.intgetType()parse(ByteBuffer buffer) Parses a pre-shared key extension (ClientHello variant) from a byte stream.
-
Constructor Details
-
ClientHelloPreSharedKeyExtension
-
-
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:ExtensionSerializes 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 hellopskExtensionStartPosition- the position of this extension in the serialized client hellotranscriptPrefix- 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.2calculator- 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
-