pcpp::SSLHandshakeMessage Class Referenceabstract

#include <SSLHandshake.h>

Inheritance diagram for pcpp::SSLHandshakeMessage:
pcpp::SSLCertificateMessage pcpp::SSLCertificateRequestMessage pcpp::SSLCertificateVerifyMessage pcpp::SSLClientHelloMessage pcpp::SSLClientKeyExchangeMessage pcpp::SSLFinishedMessage pcpp::SSLHelloRequestMessage pcpp::SSLNewSessionTicketMessage pcpp::SSLServerHelloDoneMessage pcpp::SSLServerHelloMessage pcpp::SSLServerKeyExchangeMessage pcpp::SSLUnknownMessage

Public Member Functions

virtual SSLHandshakeType getHandshakeType ()
virtual size_t getMessageLength ()
virtual bool isMessageComplete ()
SSLHandshakeLayergetContainingLayer ()
virtual std::string toString ()=0

Static Public Member Functions

static SSLHandshakeMessagecreateHandhakeMessage (uint8_t *data, size_t dataLen, SSLHandshakeLayer *container)

Detailed Description

A base class for SSL/TLS handshake messages. This is an abstract class and cannot be instantiated. SSL/TLS handshake messages are contained in SSLHandshakeLayer, meaning a SSLHandshakeLayer instance can contain one or more SSLHandshakeMessage instances. For example: one SSLHandshakeLayer may contain a server-hello, certificate, server-key-exchange, and server-hello-done messages (although it's not such a common case, most handshake layers contain 1 handshake message only)

Member Function Documentation

static SSLHandshakeMessage* pcpp::SSLHandshakeMessage::createHandhakeMessage ( uint8_t *  data,
size_t  dataLen,
SSLHandshakeLayer container 

A factory method for creating instances of handshake messages from raw data

[in]dataThe raw data containing 1 handshake message
[in]dataLenRaw data length in bytes
[in]containerA pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
SSLHandshakeLayer* pcpp::SSLHandshakeMessage::getContainingLayer ( )
A pointer to the SSLHandshakeLayer instance containing this message
virtual SSLHandshakeType pcpp::SSLHandshakeMessage::getHandshakeType ( )
The handshake message type

Reimplemented in pcpp::SSLUnknownMessage.

virtual size_t pcpp::SSLHandshakeMessage::getMessageLength ( )
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet

Reimplemented in pcpp::SSLUnknownMessage.

virtual bool pcpp::SSLHandshakeMessage::isMessageComplete ( )
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)