ClientKeyExchange

class mtf.network_port.tls.tls_helpers.ClientKeyExchange

Represents the TLS Handshake protocol Client Key Exchange message.

This message is used by the client to provide key exchange information to the server as part of the TLS handshake.

Attributes:

version (Optional[ProtocolVersion]): The TLS version used for the handshake. identity (Optional[bytes]): The client’s cryptographic identity, often

containing key exchange material.

__init__(version: ProtocolVersion | None = None, identity: bytes | None = None)

Initialize the ClientKeyExchange message.

Args:

version (Optional[ProtocolVersion]): The TLS version for the handshake. identity (Optional[bytes]): The client’s cryptographic identity or key exchange data.

parse(parser: Parser)

Deserialize the message from a Parser object.

Args:

parser (Parser): The parser used to read and extract data.

Returns:

ClientKeyExchange: The current instance with data populated from the parser.

write()

Serialize the message into a bytearray.

Returns:

bytearray: The serialized message.

create()

Create a new ClientKeyExchange message instance.

Returns:

ClientKeyExchange: The new instance of the ClientKeyExchange message.

postWrite(w)