Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

SslCtx.h

Go to the documentation of this file.
00001 #ifndef __SSL_CTX_H__
00002 #define __SSL_CTX_H__
00003 
00004 #include <openssl/rsa.h>
00005 #include <openssl/crypto.h>
00006 #include <openssl/x509.h>
00007 #include <openssl/pem.h>
00008 #include <openssl/ssl.h>
00009 #include <openssl/err.h>
00010 #include <openssl/rand.h>
00011 #include <string>
00012 
00013 class SslCtx
00014 {
00015 public:
00016     SslCtx();
00017     ~SslCtx();
00018 
00019     SSL_CTX* getSslCtx();
00020 
00021     long setOptions(long);
00022     long getOptions();
00023     void setPrivateKeyPassword(string password);
00024     bool setCertificateFile(string certificateFile);
00025     bool setPrivateKeyFile(string privateKeyFile);
00026     bool setPrivateKeyFile(string privateKeyFile, string privateKeyPassword);
00027     bool setCertificateAuthorityFile(string caFile, string caPath);
00028 
00029 private:
00030     long setDefaultOptions();
00031 
00032     static int verify_callback(int ok, X509_STORE_CTX *ctx);
00033     //static int key_callback(char *buf, int len, int rwflag, void* user_data);
00034     static int getPrivateKeyPasswordCallback(char *buf, int len, int rwflag, void* user_data);
00035     //int useRsaPrivateKeyFile(char *key_file, char *key_passwd);
00036         
00038     SSL_CTX *m_sslCtx;
00039 
00041     std::string m_privateKeyPassword;
00042 };
00043 
00044 #endif

Generated at Thu Jul 11 13:31:52 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001