EHS
SSL.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Str.h"
5#include "TCP.h"
6#include "Request.h"
7#include "Response.h"
8
9typedef struct ssl_ctx_st SSL_CTX;
10typedef struct ssl_st SSL;
11
12namespace ehs
13{
15 class EHS_LIB_IO SSL : public TCP
16 {
17 private:
18 SSL_CTX* ctx;
19 ::SSL* sslHdl;
20
21 public:
22 ~SSL() override;
23
24 SSL();
25
26 SSL(const IP type);
27
28 SSL(TCP&& tcp) noexcept;
29
30 SSL(const TCP& tcp);
31
32 SSL(const SSL& ssl);
33
34 SSL& operator=(const SSL& ssl);
35
36 void Initialize() override;
37
38 void Release() override;
39
40 void Bind(const Str_8& address, unsigned short port) override;
41
42 SSL* Accept() override;
43
44 void Connect(const Str_8& address, const UInt_16 port) override;
45
46 UInt_64 Send(const Byte* const buffer, const UInt_32 size) override;
47
48 UInt_64 Receive(Byte* const buffer, const UInt_32 size) override;
49
50 void UseCertificate(const Byte* data, const UInt_64 size);
51
52 void UsePrivateKey(const Byte* data, const UInt_64 size);
53
54 bool IsValid();
55 };
56}
struct ssl_ctx_st SSL_CTX
Definition: SSL.h:9
struct ssl_st SSL
Definition: SSL.h:10
A class for handling the HTTP(S) TCP socket layer.
Definition: SSL.h:16
A wrapper class for the transmission control protocol socket.
Definition: TCP_BSD.h:14
Definition: Anchor.h:6
unsigned int UInt_32
Definition: Types.h:49
IP
Definition: Socket.h:29
EHS_LIB_IO void Initialize(Str_8 appName, Str_8 appVerId, const Version &appVer)
Definition: EHS.cpp:34
unsigned char Byte
Definition: Types.h:39
unsigned short UInt_16
Definition: Types.h:46