tlsdefault.h
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
00033 class GLOOX_API TLSDefault : public TLSBase
00034 {
00035 public:
00036
00040 enum Type
00041 {
00042 VerifyingClient = 1,
00044 AnonymousClient = 2,
00046 VerifyingServer = 4,
00047 AnonymousServer = 8
00049 };
00050
00057 TLSDefault( TLSHandler* th, const std::string server, Type type = VerifyingClient );
00058
00062 virtual ~TLSDefault();
00063
00064
00065 virtual bool init( const std::string& clientKey = EmptyString,
00066 const std::string& clientCerts = EmptyString,
00067 const StringList& cacerts = StringList() );
00068
00069
00070 virtual bool encrypt( const std::string& data );
00071
00072
00073 virtual int decrypt( const std::string& data );
00074
00075
00076 virtual void cleanup();
00077
00078
00079 virtual bool handshake();
00080
00081
00082 virtual bool isSecure() const;
00083
00084
00085 virtual void setCACerts( const StringList& cacerts );
00086
00087
00088 virtual const CertInfo& fetchTLSInfo() const;
00089
00090
00091 virtual void setClientCert( const std::string& clientKey, const std::string& clientCerts );
00092
00097 static int types();
00098
00099 private:
00100 TLSBase* m_impl;
00101
00102 };
00103 }
00104
00105 #endif // TLSDEFAULT_H__