00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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
00062 virtual bool init();
00063
00064
00065 virtual bool encrypt( const std::string& data );
00066
00067
00068 virtual int decrypt( const std::string& data );
00069
00070
00071 virtual void cleanup();
00072
00073
00074 virtual bool handshake();
00075
00076
00077 virtual bool isSecure() const;
00078
00079
00080 virtual void setCACerts( const StringList& cacerts );
00081
00082
00083 virtual const CertInfo& fetchTLSInfo() const;
00084
00085
00086 virtual void setClientCert( const std::string& clientKey, const std::string& clientCerts );
00087
00092 static int types();
00093
00094 private:
00095 TLSBase* m_impl;
00096 };
00097 }
00098
00099 #endif // TLSDEFAULT_H__