Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

SSLContext.h

00001 /* Copyright (c) 2003 EU DataGrid. */
00002 /* For license conditions see http://www.eu-datagrid.org/license.html */
00003 
00004 #ifndef INFO_SSLCONTEXT_H
00005 #define INFO_SSLCONTEXT_H
00006 
00007 #include "rgma/RGMAException.h"
00008 #include <string>
00009 
00010 // OpenSSL types
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                 //static const class APILogging& cat;
00033 
00037                 SSL_CTX *context;
00038 
00042                 static std::string passwordStatic;
00043 
00044                 /*
00045                  * Location of SSL CA files
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                 /* OpenSSL callback functions - called from OpenSSL */
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

Generated on Wed May 17 17:48:18 2006 for glite-rgma-api-cpp by doxygen 1.3.5