/
Sender.h
43 lines (30 loc) · 832 Bytes
/
Sender.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Sender.h
*
* Created on: Apr 28, 2017
* Author: bulldozer00
*/
#ifndef SENDER_H_
#define SENDER_H_
#include <string>
#include "Poco/SHA1Engine.h"
#include "ChannelMessage.h"
class Recipient;
class ChannelMsg;
class Sender {
public:
Sender();
void setTheMessage(const std::string& msgToSend);
void hashMsg(const std::string& msgToSend);
std::string fingerPrintTheMessage();
bool sendChannelMsg(const std::string& msgToSend, Recipient& receiver);
bool sendChannelMsg(const ChannelMsg& cmsg, Recipient& receiver);
//Simulate a man in the middle
bool sendAlteredChannelMsg(const std::string& msgToSend, Recipient& receiver);
private:
//Msg, fngerprint, hash engine
std::string _msgTxt { };
std::string _msgFingerPrint { };
Poco::SHA1Engine _sha1Engine { };
};
#endif /* SENDER_H_ */