Botan 3.13.0
Crypto and TLS for C&
tls_handshake_msg.h
Go to the documentation of this file.
1/*
2* TLS Handshake Message
3* (C) 2012 Jack Lloyd
4* 2016 Matthias Gierlings
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#ifndef BOTAN_TLS_HANDSHAKE_MSG_H_
10#define BOTAN_TLS_HANDSHAKE_MSG_H_
11
12#include <botan/tls_magic.h>
13#include <string>
14#include <vector>
15
16namespace Botan::TLS {
17
18class Handshake_IO;
19class Handshake_Hash;
20
21/**
22* TLS Handshake Message Base Class
23*/
25 public:
26 /**
27 * Return a free-form string describing this message type
28 *
29 * @return string representation of this message type
30 */
31 std::string type_string() const;
32
33 /**
34 * Return the TLS handshake type code
35 * @return the message type
36 */
37 virtual Handshake_Type type() const = 0;
38
39 /**
40 * Return the wire encoding of the message type code
41 *
42 * @note This is usually equal to `type` with the exception of
43 * a TLS 1.3 Helloy Retry Request.
44 *
45 * @return the wire representation of the message's type
46 */
47 virtual Handshake_Type wire_type() const { return type(); }
48
49 /**
50 * Serialize this handshake message
51 */
52 virtual std::vector<uint8_t> serialize() const = 0;
53
54 virtual ~Handshake_Message() = default;
55 Handshake_Message() = default;
60};
61
62} // namespace Botan::TLS
63
64#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
Handshake_Message & operator=(const Handshake_Message &)=delete
Handshake_Message & operator=(Handshake_Message &&)=default
Handshake_Message(Handshake_Message &&)=default
virtual ~Handshake_Message()=default
virtual Handshake_Type type() const =0
virtual std::vector< uint8_t > serialize() const =0
virtual Handshake_Type wire_type() const
Handshake_Message(const Handshake_Message &)=delete