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
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 encrypt( const std::string& data );
00063
00064
00065 virtual int decrypt( const std::string& data );
00066
00067
00068 virtual void cleanup();
00069
00070
00071 virtual bool handshake();
00072
00073
00074 virtual bool isSecure() const;
00075
00076
00077 virtual void setCACerts( const StringList& cacerts );
00078
00079
00080 virtual const CertInfo& fetchTLSInfo() const;
00081
00082
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__