Public Types |
typedef int(* | VERIFY_CALLBACK )(int ok, X509_STORE_CTX *store) |
| \typedef Define a type for describing a verification callback. More...
|
typedef DH *(* | DHPARM_CALLBACK )(SSL *ssl, int is_export, int keylen) |
| Define a type for describing a DH-parm generation callback. More...
|
typedef SSL_CTX * | SSL_CTX_PTR |
| Define a type for use in the cbits::SSLContext-to-SSL_CTX conversion operatir. More...
|
enum | PEER_AUTH_LEVEL { NONE = 1,
PRESENT,
REQUIRED
} |
| Authentication levels to which a peer may be required to comply. More...
|
Public Methods |
| SSLContext (const char *cert_chain_path, const char *private_key_path, const char *trusted_path, PEER_AUTH_LEVEL level, const char *pk_passwd=0, const bool export_only=false, const void *random=0, const int ran_len=0) throw ( SSLContextException ) |
| Create a SSL context to be used in establishing future SSL connections. More...
|
virtual | ~SSLContext () |
| Destructor. More...
|
void | setDHParmCallback (DHPARM_CALLBACK cb) throw ( SSLContextException ) |
| Provide user-specified callback that will provide Diffie-Hellman parameters upon demand. More...
|
| operator SSL_CTX_PTR () |
| Type conversion operator to convert a SSLContext into an OpenSSL SSL_CTX pointer. More...
|
Static Public Methods |
void * | setVerifyCallback (VERIFY_CALLBACK cback) throw ( SSLContextException ) |
| Set a user-provided function to be called during peer certificate validation. More...
|
Static Protected Methods |
const bool | init_lib (const void *buffer=0, const int buflen=0) |
| Initialize the OpenSSL library. More...
|
int | verify_callback (int ok, X509_STORE_CTX *store) |
| Default verify callback. More...
|
Static Private Methods |
void | mt_setup (void) |
| Setup the mutexes for use by the OpenSSL library. More...
|
void | mt_cleanup (void) |
| Cleanup the mutexes used by the OpenSSL library before shutting down. More...
|
void | mt_lock_n (int mode, int n, const char *file, int line) |
| Callback used by OpenSSL library to 'lock mutext "n"'. More...
|
unsigned long | mt_get_tid (void) |
| Callback used by OpenSSL library to determine the ID of the current thread. More...
|
int | passwd_cb (char *buf, int sz, int flg, void *userdata) |
| OpenSSL Callback used to get password for private key file. More...
|
Private Attributes |
std::string | _cert_path |
| Path to this principal's certificate chain in PEM format. More...
|
std::string | _pkey_path |
| Path to this principal's private key in PEM format. More...
|
std::string | _trusted_path |
| Path to PEM encoded file of trusted (CA) certificates used to validate peer certificates during SSL handshake. More...
|
SSL_CTX * | _ssl_ctx |
| The underlying OpenSSL library security context. More...
|
int | _verify_level |
| Level of peer authentication. More...
|
bool | _export_only |
| State flag indicating, if true, that only export-level ciphers will be used. More...
|
std::string | _passphrase |
| Passphrase for private key. More...
|
Static Private Attributes |
bool | _is_lib_inited = false |
| State flag indicating whether or not the OpenSSL library has been initialized. More...
|
std::vector< MUTEX_TYPE > | _mutex |
| List of mutexes provided for OpenSSL library use. More...
|
CriticalSection | _csect |
| critical section used to prevent concurrent initialization of the OpenSSL library. More...
|
VERIFY_CALLBACK | _client_verify_cb = 0 |
| Client peer certificat verification callback, if set. More...
|
long int | _num_contexts = 0 |
| the number of cbits::SSLContext instances that have been created. More...
|