tlsdefault.h
/*
* Copyright (c) 2007-2023 by Jakob Schröter <js@camaya.net>
* This file is part of the gloox library. http://camaya.net/gloox
*
* This software is distributed under a license. The full license
* agreement can be found in the file LICENSE in this distribution.
* This software may not be copied, modified, sold or distributed
* other than expressed in the named license agreement.
*
* This software is distributed without any warranty.
*/
#ifndef TLSDEFAULT_H__
#define TLSDEFAULT_H__
#include "tlsbase.h"
namespace gloox
{
class TLSHandler;
class GLOOX_API TLSDefault : public TLSBase
{
public:
enum Type
{
VerifyingClient = 1,
AnonymousClient = 2,
VerifyingServer = 4,
AnonymousServer = 8
};
TLSDefault( TLSHandler* th, const std::string server, Type type = VerifyingClient );
virtual ~TLSDefault();
// reimplemented from TLSBase
virtual bool init( const std::string& clientKey = EmptyString,
const std::string& clientCerts = EmptyString,
const StringList& cacerts = StringList() );
// reimplemented from TLSBase
virtual bool encrypt( const std::string& data );
// reimplemented from TLSBase
virtual int decrypt( const std::string& data );
// reimplemented from TLSBase
virtual void cleanup();
// reimplemented from TLSBase
virtual bool handshake();
// reimplemented from TLSBase
virtual bool isSecure() const;
// reimplemented from TLSBase
virtual bool hasChannelBinding() const;
// reimplemented from TLSBase
virtual const std::string channelBinding() const;
// reimplemented from TLSBase
virtual const std::string channelBindingType() const;
// reimplemented from TLSBase
virtual void setCACerts( const StringList& cacerts );
// reimplemented from TLSBase
virtual const CertInfo& fetchTLSInfo() const;
// reimplemented from TLSBase
virtual void setClientCert( const std::string& clientKey, const std::string& clientCerts );
static int types();
private:
TLSBase* m_impl;
};
}
#endif // TLSDEFAULT_H__
gloox::TLSBase
An abstract base class for TLS implementations.
Definition tlsbase.h:32
gloox::TLSBase::TLSBase
TLSBase(TLSHandler *th, const std::string server)
Definition tlsbase.h:39
gloox::TLSDefault
This is an abstraction of the various TLS backends.
Definition tlsdefault.h:34
gloox::TLSDefault::Type
Type
Definition tlsdefault.h:41
gloox::TLSDefault::AnonymousServer
@ AnonymousServer
Definition tlsdefault.h:47
gloox::TLSDefault::VerifyingServer
@ VerifyingServer
Definition tlsdefault.h:46
gloox::TLSDefault::VerifyingClient
@ VerifyingClient
Definition tlsdefault.h:42
gloox::TLSDefault::AnonymousClient
@ AnonymousClient
Definition tlsdefault.h:44
gloox::TLSDefault::TLSDefault
TLSDefault(TLSHandler *th, const std::string server, Type type=VerifyingClient)
Definition tlsdefault.cpp:38
gloox::TLSHandler
An interface that allows for interacting with TLS implementations derived from TLSBase.
Definition tlshandler.h:35
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::StringList
std::list< std::string > StringList
Definition gloox.h:1251
gloox::EmptyString
const std::string EmptyString
Definition gloox.cpp:124
gloox::CertInfo
Definition gloox.h:990