00001
00002
00003
00004 #ifndef INFO_SSLCONTEXT_H
00005 #define INFO_SSLCONTEXT_H
00006
00007 #include "rgma/RGMAException.h"
00008 #include <string>
00009
00010
00011 typedef struct ssl_ctx_st SSL_CTX;
00012
00013 namespace glite
00014 {
00015 namespace rgma
00016 {
00017
00018 class SSLContextProperties;
00019
00029 class SSLContext
00030 {
00031 private:
00032
00033
00037 SSL_CTX *context;
00038
00042 static std::string passwordStatic;
00043
00044
00045
00046
00047 static std::string sslCAFilesStatic;
00048
00049 public:
00050
00054 SSLContext();
00055
00056 virtual ~SSLContext();
00057
00062 void flush();
00063
00068 SSL_CTX* get();
00069
00073 static const std::string& SSLContext::getSslCAFiles();
00074
00075 private:
00076
00077
00082 static int getPasswordCallback(char *buf, int size, int rwflag, void *unused);
00083
00088 void useClientProxyCertificateFile(SSL_CTX *context,
00089 std::string file) throw (RGMAException);
00090
00094 void useClientCertificateAndKeyFiles(SSL_CTX *context,
00095 SSLContextProperties &props);
00096
00097 };
00098 }
00099 }
00100 #endif // EDG_INFO_SSLCONTEXT_H