15 #ifndef TLSGNUTLSBASE_H__
16 #define TLSGNUTLSBASE_H__
24 #include <gnutls/gnutls.h>
25 #include <gnutls/x509.h>
54 virtual bool encrypt(
const std::string& data );
57 virtual int decrypt(
const std::string& data );
75 virtual void setClientCert(
const std::string& ,
const std::string& ) {}
78 virtual void getCertInfo() {}
80 void getCommonCertInfo();
82 gnutls_session_t* m_session;
84 std::string m_recvBuffer;
88 ssize_t pullFunc(
void* data,
size_t len );
89 static ssize_t pullFunc( gnutls_transport_ptr_t ptr,
void* data,
size_t len );
91 ssize_t pushFunc(
const void* data,
size_t len );
92 static ssize_t pushFunc( gnutls_transport_ptr_t ptr,
const void* data,
size_t len );
This is the common base class for (stream) encryption using GnuTLS.
virtual bool encrypt(const std::string &data)
virtual void setClientCert(const std::string &, const std::string &)
virtual const std::string channelBinding() const
virtual bool hasChannelBinding() const
virtual void setCACerts(const StringList &)
GnuTLSBase(TLSHandler *th, const std::string &server=EmptyString)
virtual int decrypt(const std::string &data)
An abstract base class for TLS implementations.
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