tlsdefault.h

00001 /*
00002  * Copyright (c) 2007-2008 by Jakob Schroeter <js@camaya.net>
00003  * This file is part of the gloox library. http://camaya.net/gloox
00004  *
00005  * This software is distributed under a license. The full license
00006  * agreement can be found in the file LICENSE in this distribution.
00007  * This software may not be copied, modified, sold or distributed
00008  * other than expressed in the named license agreement.
00009  *
00010  * This software is distributed without any warranty.
00011  */
00012 
00013 
00014 #ifndef TLSDEFAULT_H__
00015 #define TLSDEFAULT_H__
00016 
00017 #include "tlsbase.h"
00018 
00019 namespace gloox
00020 {
00021 
00022   class TLSHandler;
00023 
00030   class GLOOX_API TLSDefault : public TLSBase
00031   {
00032     public:
00033 
00037       enum Type
00038       {
00039         VerifyingClient   =  1,     
00041         AnonymousClient   =  2,     
00043         VerifyingServer   =  4,     
00044         AnonymousServer   =  8      
00046       };
00047 
00054       TLSDefault( TLSHandler *th, const std::string server, Type type = VerifyingClient );
00055 
00059       virtual ~TLSDefault();
00060 
00061       // re-implemented from TLSBase
00062       virtual bool encrypt( const std::string& data );
00063 
00064       // re-implemented from TLSBase
00065       virtual int decrypt( const std::string& data );
00066 
00067       // re-implemented from TLSBase
00068       virtual void cleanup();
00069 
00070       // re-implemented from TLSBase
00071       virtual bool handshake();
00072 
00073       // re-implemented from TLSBase
00074       virtual bool isSecure() const;
00075 
00076       // re-implemented from TLSBase
00077       virtual void setCACerts( const StringList& cacerts );
00078 
00079       // re-implemented from TLSBase
00080       virtual const CertInfo& fetchTLSInfo() const;
00081 
00082       // re-implemented from TLSBase
00083       virtual void setClientCert( const std::string& clientKey, const std::string& clientCerts );
00084 
00089       static int types();
00090 
00091     private:
00092       TLSBase* m_impl;
00093   };
00094 }
00095 
00096 #endif // TLSDEFAULT_H__

Generated on Sun Apr 27 11:08:13 2008 for gloox by  doxygen 1.5.5