Context.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Context.h
8  *
9  * @author: 2019 - Slavey Karadzhov <slav@attachix.com>
10  *
11  ****/
12 
13 #pragma once
14 
15 #include "Connection.h"
16 #include "KeyCertPair.h"
17 #include "Validator.h"
18 
19 struct tcp_pcb;
20 
21 namespace Ssl
22 {
23 class Session;
24 
28 class Context
29 {
30 public:
31  Context(Session& session) : session(session)
32  {
33  }
34 
35  virtual ~Context()
36  {
37  }
38 
44  virtual bool init() = 0;
45 
51  virtual Connection* createClient(tcp_pcb* tcp) = 0;
52 
58  virtual Connection* createServer(tcp_pcb* tcp) = 0;
59 
60 public:
62 };
63 
64 } // namespace Ssl
Definition: Alert.h:15
Implemented by SSL adapter to handle a connection.
Definition: Connection.h:35
virtual Connection * createClient(tcp_pcb *tcp)=0
Creates client SSL connection. Your SSL client use this call to create a client connection to remote ...
Context(Session &session)
Definition: Context.h:31
Handles all SSL activity for a TCP connection.
Definition: Session.h:76
virtual bool init()=0
Initializer method that must be called after object creation and before the creation of server or cli...
virtual ~Context()
Definition: Context.h:35
virtual Connection * createServer(tcp_pcb *tcp)=0
Creates server SSL connection. Your SSL servers use this call to allow remote clients to connect to t...
Implemented by SSL adapter to create and manage SSL connections.
Definition: Context.h:28
Session & session
Definition: Context.h:61