ServerKeyExchange

class mtf.network_port.tls.tls_helpers.ServerKeyExchange

Handles TLS Handshake protocol Server Key Exchange messages.

This class is responsible for creating, serializing, and deserializing Server Key Exchange messages, which are used in the TLS handshake process to exchange cryptographic parameters between the server and the client.

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

Initialize the Server Key Exchange message.

Args:

version (Optional[ProtocolVersion]): The TLS version being used. identity (Optional[bytes]): The server’s cryptographic identity, typically

an integer derived from a public key or other cryptographic material.

parse(parser: Parser)

Deserialize the Server Key Exchange message from a Parser.

Args:

parser (Parser): The parser to read data from.

Returns:

ServerKeyExchange: The parsed Server Key Exchange message.

write()

Serialize the Server Key Exchange message into a bytearray.

Returns:

bytearray: The serialized Server Key Exchange message.

create()

Create a new Server Key Exchange message.

Returns:

ServerKeyExchange: The newly created Server Key Exchange message.

postWrite(w)