ldapsdk  0.0.1
Public Types | Public Member Functions | Friends | List of all members
TlsOptions Class Reference

Class to access the global (and connection specific) TLS Settings To access the global TLS Settings just instantiate a TlsOption object using the default constructor. More...

#include <TlsOptions.h>

Public Types

enum  tls_option {
  CACERTFILE =0, CACERTDIR, CERTFILE, KEYFILE,
  REQUIRE_CERT, PROTOCOL_MIN, CIPHER_SUITE, RANDOM_FILE,
  CRLCHECK, DHFILE
}
 Available TLS Options. More...
 
enum  verifyMode {
  NEVER =0, HARD, DEMAND, ALLOW,
  TRY
}
 Possible Values for the REQUIRE_CERT option. More...
 
enum  crlMode { CRL_NONE =0, CRL_PEER, CRL_ALL }
 Possible Values for the CRLCHECK option. More...
 

Public Member Functions

 TlsOptions ()
 Default constructor. More...
 
void setOption (tls_option opt, const std::string &value) const
 Set string valued options. More...
 
void setOption (tls_option opt, int value) const
 Set integer valued options. More...
 
void setOption (tls_option opt, void *value) const
 Generic setOption variant. More...
 
int getIntOption (tls_option opt) const
 Read integer valued options. More...
 
std::string getStringOption (tls_option opt) const
 Read string valued options. More...
 
void getOption (tls_option opt, void *value) const
 Read options value. More...
 

Friends

class LDAPAsynConnection
 

Detailed Description

Class to access the global (and connection specific) TLS Settings To access the global TLS Settings just instantiate a TlsOption object using the default constructor.

To access connection specific settings instantiate a TlsOption object through the getTlsOptions() method from the corresponding LDAPConnection/LDAPAsynConnection object.

Member Enumeration Documentation

Possible Values for the CRLCHECK option.

Enumerator
CRL_NONE 
CRL_PEER 
CRL_ALL 

Available TLS Options.

Enumerator
CACERTFILE 
CACERTDIR 
CERTFILE 
KEYFILE 
REQUIRE_CERT 
PROTOCOL_MIN 
CIPHER_SUITE 
RANDOM_FILE 
CRLCHECK 
DHFILE 

Possible Values for the REQUIRE_CERT option.

Enumerator
NEVER 
HARD 
DEMAND 
ALLOW 
TRY 

Constructor & Destructor Documentation

TlsOptions::TlsOptions ( )

Default constructor.

Gives access to the global TlsSettings

Member Function Documentation

int TlsOptions::getIntOption ( tls_option  opt) const

Read integer valued options.

Returns
Option value
Exceptions
LDAPExceptionin case of error (invalid on non-integer valued option is requested)

References INT.

void TlsOptions::getOption ( tls_option  opt,
void *  value 
) const

Read options value.

Usually you should prefer to use either getIntOption() or getStringOption()

Parameters
valuepoints to a buffer containing the option value
Exceptions
LDAPExceptionin case of error (invalid on non-string valued option is requested)
std::string TlsOptions::getStringOption ( tls_option  opt) const

Read string valued options.

Returns
Option value
Exceptions
LDAPExceptionin case of error (invalid on non-string valued option is requested)

References STRING.

void TlsOptions::setOption ( tls_option  opt,
const std::string &  value 
) const

Set string valued options.

Parameters
optThe following string valued options are available:
valueThe value to apply to that option,

References CACERTDIR, CACERTFILE, CERTFILE, KEYFILE, setOption(), and STRING.

Referenced by setOption().

void TlsOptions::setOption ( tls_option  opt,
int  value 
) const

Set integer valued options.

Parameters
optThe following string valued options are available:
valueThe value to apply to that option,

References INT, and setOption().

void TlsOptions::setOption ( tls_option  opt,
void *  value 
) const

Generic setOption variant.

Generally you should prefer to use one of the other variants

Friends And Related Function Documentation

friend class LDAPAsynConnection
friend

The documentation for this class was generated from the following files: