gloox  1.0.16
tlsgnutlsserveranon.h
1 /*
2  Copyright (c) 2007-2015 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 
15 #ifndef TLSGNUTLSSERVERANON_H__
16 #define TLSGNUTLSSERVERANON_H__
17 
18 #include "tlsgnutlsbase.h"
19 
20 #include "config.h"
21 
22 #ifdef HAVE_GNUTLS
23 
24 #include <gnutls/gnutls.h>
25 #include <gnutls/x509.h>
26 
27 namespace gloox
28 {
29 
39  {
40  public:
46 
50  virtual ~GnuTLSServerAnon();
51 
52  // reimplemented from TLSBase
53  virtual bool init( const std::string& clientKey = EmptyString,
54  const std::string& clientCerts = EmptyString,
55  const StringList& cacerts = StringList() );
56 
57  // reimplemented from TLSBase
58  virtual void cleanup();
59 
60  private:
61  virtual void getCertInfo();
62  void generateDH();
63 
64  gnutls_anon_server_credentials_t m_anoncred;
65  gnutls_dh_params_t m_dhParams;
66 
67  const int m_dhBits;
68 
69  };
70 
71 }
72 
73 #endif // HAVE_GNUTLS
74 
75 #endif // TLSGNUTLSSERVERANON_H__
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())
std::list< std::string > StringList
Definition: gloox.h:1244
The namespace for the gloox library.
Definition: adhoc.cpp:27
This is the common base class for (stream) encryption using GnuTLS.
Definition: tlsgnutlsbase.h:38
This class implements (stream) encryption using GnuTLS server-side.
An interface that allows for interacting with TLS implementations derived from TLSBase.
Definition: tlshandler.h:34
const std::string EmptyString
Definition: gloox.cpp:123