Botan 3.0.0-alpha0
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 <vector>
14#include <string>
15
16namespace Botan {
17
18namespace TLS {
19
20class Handshake_IO;
21class Handshake_Hash;
22
23/**
24* TLS Handshake Message Base Class
25*/
27 {
28 public:
29 /**
30 * @return string representation of this message type
31 */
32 std::string type_string() const;
33
34 /**
35 * @return the message type
36 */
37 virtual Handshake_Type type() const = 0;
38
39 /**
40 * @return the wire representation of the message's type
41 */
42 virtual Handshake_Type wire_type() const
43 {
44 // Usually equal to the Handshake_Type enum value,
45 // with the exception of TLS 1.3 Hello Retry Request.
46 return type();
47 }
48
49 /**
50 * @return DER representation of this message
51 */
52 virtual std::vector<uint8_t> serialize() const = 0;
53
54 virtual ~Handshake_Message() = default;
55 Handshake_Message() = default;
60 };
61
62}
63
64}
65
66#endif
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
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Definition: alg_id.cpp:13
MechanismType type