include/TransportTLSCommon.H

Go to the documentation of this file.
00001 /* ${copyright}$ */
00002 /* $Id: TransportTLSCommon.H 748 2006-06-06 13:47:41Z koji $ */
00007 #ifndef __TRANSPORTTLSCOMMON_H__
00008 #define __TRANSPORTTLSCOMMON_H__
00009 
00010 #include <string>
00011 
00012 #include <openssl/bio.h>
00013 #include <openssl/ssl.h>
00014 
00015 #include "libepp_nicbr.H"
00016 
00017 #include "StrUtil.H"
00018 
00019 using std::string;
00020 
00021 LIBEPP_NICBR_NS_BEGIN
00022 
00024 class TransportTLSCommon
00025 {
00026 public:
00028   TransportTLSCommon();
00029 
00031   ~TransportTLSCommon();
00032 
00034 
00038   void read(string &xml_payload, const int &timeout = TIMEOUT);
00039 
00041 
00045   void write(const string &xml_payload, const int &timeout = TIMEOUT);
00046 
00048   void disconnect();
00049 
00051 
00054   string get_openssl_msg();
00055 
00056 protected:
00058   void seed_prng();
00059 
00061 
00069   static int pem_passwd_cb(char *buf, int size, int rwflag, void *userdata);
00070 
00072 
00077   void setup_context(const string &cert_file,
00078                      const string &root_ca_file,
00079                      const string &pem_passphrase = "");
00080 
00082   void set_non_blocking();
00083 
00085   BIO *_conn;
00086 
00088   SSL_CTX *_ssl_ctx;
00089 
00091   SSL *_ssl;
00092 
00094   static string _pem_passphrase;
00095 
00097   static const int TIMEOUT;
00098 };
00099 
00100 LIBEPP_NICBR_NS_END
00101 #endif //__TRANSPORTTLSCOMMON_H__

Generated on Thu Jun 8 17:40:00 2006 for libepp_nicbr by  doxygen 1.4.6