Nuria Framework - Network
Network module of the NuriaProject Framework
 All Classes Functions Typedefs Enumerations Enumerator
sslserver.hpp
1 /* Copyright (c) 2014, The Nuria Project
2  * This software is provided 'as-is', without any express or implied
3  * warranty. In no event will the authors be held liable for any damages
4  * arising from the use of this software.
5  * Permission is granted to anyone to use this software for any purpose,
6  * including commercial applications, and to alter it and redistribute it
7  * freely, subject to the following restrictions:
8  * 1. The origin of this software must not be misrepresented; you must not
9  * claim that you wrote the original software. If you use this software
10  * in a product, an acknowledgment in the product documentation would be
11  * appreciated but is not required.
12  * 2. Altered source versions must be plainly marked as such, and must not be
13  * misrepresented as being the original software.
14  * 3. This notice may not be removed or altered from any source
15  * distribution.
16  */
17 
18 #ifndef NURIA_SSLSERVER_HPP
19 #define NURIA_SSLSERVER_HPP
20 
21 #include "network_global.hpp"
22 #include <QSslCertificate>
23 #include <QTcpServer>
24 #include <QSslError>
25 #include <QSslKey>
26 
27 namespace Nuria {
28 class SslServerPrivate;
29 
35 class NURIA_NETWORK_EXPORT SslServer : public QTcpServer {
36  Q_OBJECT
37 public:
38  explicit SslServer (QObject *parent = 0);
39  ~SslServer ();
40 
41  const QSslKey &privateKey () const;
42  const QSslCertificate &localCertificate () const;
43 
44  void setPrivateKey (const QSslKey &key);
45  void setLocalCertificate (const QSslCertificate &cert);
46 
47 private slots:
48 
49  void connectionEncrypted ();
50  void sslError (QList< QSslError > errors);
51 
52 protected:
53 
54  virtual void incomingConnection (int handle);
55 
56 private:
57 
58  //
59  SslServerPrivate *d_ptr;
60 
61 };
62 }
63 
64 #endif // NURIA_SSLSERVER_HPP
Definition: sslserver.hpp:35