Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
encryptionexchange.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_ENCRYPTIONEXCHANGE_H
13#define MINESERVER_ENCRYPTIONEXCHANGE_H
14
15#include <net/packet.h>
16#include <plugins/luaheaders.h>
17
29{
30private:
31 void write(IMCStream *stream) override;
32
33public:
45 ~EncryptionRequest() override = default;
46
51 std::byte *verifyToken;
57
61 void read(IMCStream *stream) override;
62};
63
75{
76private:
80 void write(IMCStream *stream) override;
81
82public:
92 ~EncryptionResponse() override = default;
93
104 std::unique_ptr<std::byte[]> sharedSecret;
115 std::unique_ptr<std::byte[]> verifyToken;
116
122 void read(IMCStream *stream) override;
123};
124
125#endif // MINESERVER_ENCRYPTIONEXCHANGE_H
Encryption Request Packet.
Definition encryptionexchange.h:29
std::byte * verifyToken
The pointer to the verify token.
Definition encryptionexchange.h:51
~EncryptionRequest() override=default
Destroy the Encryption Request object.
void read(IMCStream *stream) override
Definition encryptionexchange.cpp:28
int verifyTokenLength
The length of the verify token.
Definition encryptionexchange.h:56
EncryptionRequest(std::byte *verifyToken, int verifyTokenLength)
Construct a new Encryption Request object.
Definition encryptionexchange.h:40
Encryption Response Packet.
Definition encryptionexchange.h:75
EncryptionResponse()
Construct a new Encryption Response object.
Definition encryptionexchange.h:87
std::unique_ptr< std::byte[]> sharedSecret
The shared secret between the two clients.
Definition encryptionexchange.h:104
size_t verifyTokenLength
The length of the verify token.
Definition encryptionexchange.h:109
void read(IMCStream *stream) override
Reads the packet from the stream.
Definition encryptionexchange.cpp:42
std::unique_ptr< std::byte[]> verifyToken
The verify token.
Definition encryptionexchange.h:115
~EncryptionResponse() override=default
Destroy the Encryption Response object.
size_t sharedSecretLength
The length of the shared secret.
Definition encryptionexchange.h:98
Stream interface.
Definition stream.h:32
Interface for all Packets.
Definition packet.h:25
Utility header file for lua things.
The file containing the packet data.