13 #include "tlsdefault.h"
15 #include "tlshandler.h"
19 #if defined( HAVE_GNUTLS )
21 # include "tlsgnutlsclient.h"
22 # include "tlsgnutlsclientanon.h"
23 # include "tlsgnutlsserveranon.h"
24 #elif defined( HAVE_OPENSSL )
26 # include "tlsopensslclient.h"
28 # include "tlsopensslserver.h"
30 #elif defined( HAVE_WINTLS )
32 # include "tlsschannel.h"
39 :
TLSBase( th, server ), m_impl( 0 )
46 #elif defined( HAVE_OPENSSL )
48 #elif defined( HAVE_WINTLS )
80 const std::string& clientCerts,
83 return m_impl ? m_impl->
init( clientKey, clientCerts,
94 #elif defined( HAVE_OPENSSL )
97 #elif defined( HAVE_WINTLS )
105 return m_impl ? m_impl->
encrypt( data ) :
false;
110 return m_impl ? m_impl->
decrypt( data ) : 0;
121 return m_impl ? m_impl->
handshake() :
false;
126 return m_impl ? m_impl->
isSecure() :
false;
This class implements an anonymous TLS backend using GnuTLS.
virtual const CertInfo & fetchTLSInfo() const
virtual void setCACerts(const StringList &cacerts)=0
std::list< std::string > StringList
virtual const std::string channelBinding() const
virtual bool encrypt(const std::string &data)=0
virtual bool hasChannelBinding() const
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())
virtual void setClientCert(const std::string &clientKey, const std::string &clientCerts)=0
TLSDefault(TLSHandler *th, const std::string server, Type type=VerifyingClient)
The namespace for the gloox library.
This class implements a TLS backend using GnuTLS.
virtual bool handshake()=0
virtual bool isSecure() const
virtual bool hasChannelBinding() const
This class implements (stream) encryption using GnuTLS server-side.
virtual const CertInfo & fetchTLSInfo() const
virtual bool encrypt(const std::string &data)
virtual void setCACerts(const StringList &cacerts)
virtual void setClientCert(const std::string &clientKey, const std::string &clientCerts)
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())=0
virtual bool isSecure() const
virtual const std::string channelBinding() const
An abstract base class for TLS implementations.
An interface that allows for interacting with TLS implementations derived from TLSBase.
const std::string EmptyString
virtual int decrypt(const std::string &data)
virtual int decrypt(const std::string &data)=0