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.
This class implements a TLS backend using GnuTLS.
This class implements (stream) encryption using GnuTLS server-side.
An abstract base class for TLS implementations.
virtual bool encrypt(const std::string &data)=0
virtual const CertInfo & fetchTLSInfo() const
virtual int decrypt(const std::string &data)=0
virtual const std::string channelBinding() const
virtual void setClientCert(const std::string &clientKey, const std::string &clientCerts)=0
virtual bool hasChannelBinding() const
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())=0
virtual bool handshake()=0
virtual bool isSecure() const
virtual void setCACerts(const StringList &cacerts)=0
virtual bool encrypt(const std::string &data)
virtual const CertInfo & fetchTLSInfo() const
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())
virtual const std::string channelBinding() const
virtual bool hasChannelBinding() const
virtual bool isSecure() const
TLSDefault(TLSHandler *th, const std::string server, Type type=VerifyingClient)
virtual int decrypt(const std::string &data)
An interface that allows for interacting with TLS implementations derived from TLSBase.
The namespace for the gloox library.
std::list< std::string > StringList
const std::string EmptyString