Paho C++  1.0
The Paho MQTT C++ Client Library
 All Classes Files Functions Variables Typedefs Friends
mqtt::ssl_options Class Reference

Holds the set of SSL options for connection. More...

#include <ssl_options.h>

Public Types

using ptr_t = std::shared_ptr< ssl_options >
 Smart/shared pointer to an object of this class. More...
 
using const_ptr_t = std::shared_ptr< const ssl_options >
 Smart/shared pointer to a const object of this class. More...
 

Public Member Functions

 ssl_options ()
 Constructs a new MqttConnectOptions object using the default values.
 
 ssl_options (const string &trustStore, const string &keyStore, const string &privateKey, const string &privateKeyPassword, const string &enabledCipherSuites, bool enableServerCertAuth)
 Argument constructor. More...
 
 ssl_options (const ssl_options &opt)
 Copy constructor. More...
 
 ssl_options (ssl_options &&opt)
 Move constructor. More...
 
ssl_optionsoperator= (const ssl_options &opt)
 Copy assignment. More...
 
ssl_optionsoperator= (ssl_options &&opt)
 Move assignment. More...
 
string get_trust_store () const
 Returns the file containing the public digital certificates trusted by the client. More...
 
string get_key_store () const
 Returns the file containing the public certificate chain of the client. More...
 
string get_private_key () const
 Returns the file containing the client's private key. More...
 
string get_private_key_password () const
 Returns the password to load the client's privateKey if encrypted. More...
 
string get_enabled_cipher_suites () const
 Returns the list of cipher suites that the client will present to the server during the SSL handshake. More...
 
bool get_enable_server_cert_auth () const
 Returns the true/false to enable verification of the server certificate . More...
 
void set_trust_store (const string &trustStore)
 Sets the file containing the public digital certificates trusted by the client. More...
 
void set_key_store (const string &keyStore)
 Sets the file containing the public certificate chain of the client. More...
 
void set_private_key (const string &privateKey)
 Sets the file containing the client's private key. More...
 
void set_private_key_password (const string &privateKeyPassword)
 Sets the password to load the client's privateKey if encrypted. More...
 
void set_enabled_cipher_suites (const string &enabledCipherSuites)
 Sets the list of cipher suites that the client will present to the server during the SSL handshake. More...
 
void set_enable_server_cert_auth (bool enablServerCertAuth)
 Enables or disables verification of the server certificate. More...
 

Friends

class connect_options
 The connect options has special access.
 
class connect_options_test
 
class ssl_options_test
 

Detailed Description

Holds the set of SSL options for connection.

Member Typedef Documentation

using mqtt::ssl_options::const_ptr_t = std::shared_ptr<const ssl_options>

Smart/shared pointer to a const object of this class.

using mqtt::ssl_options::ptr_t = std::shared_ptr<ssl_options>

Smart/shared pointer to an object of this class.

Constructor & Destructor Documentation

mqtt::ssl_options::ssl_options ( const string &  trustStore,
const string &  keyStore,
const string &  privateKey,
const string &  privateKeyPassword,
const string &  enabledCipherSuites,
bool  enableServerCertAuth 
)

Argument constructor.

Parameters
trustStoreThe file containing the public digital certificates trusted by the client.
keyStoreThe file containing the public certificate chain of the client.
privateKeyThe file containing the client's private key.
privateKeyPasswordThe password to load the client's privateKey if encrypted.
enabledCipherSuitesThe list of cipher suites that the client will present to the server during the SSL handshake.
enableServerCertAuthTrue/False option to enable verification of the server certificate
mqtt::ssl_options::ssl_options ( const ssl_options opt)

Copy constructor.

Parameters
optThe other options to copy.
mqtt::ssl_options::ssl_options ( ssl_options &&  opt)

Move constructor.

Parameters
optThe other options to move to this one.

Member Function Documentation

bool mqtt::ssl_options::get_enable_server_cert_auth ( ) const
inline

Returns the true/false to enable verification of the server certificate .

Returns
bool
string mqtt::ssl_options::get_enabled_cipher_suites ( ) const
inline

Returns the list of cipher suites that the client will present to the server during the SSL handshake.

Returns
string
string mqtt::ssl_options::get_key_store ( ) const
inline

Returns the file containing the public certificate chain of the client.

Returns
string
string mqtt::ssl_options::get_private_key ( ) const
inline

Returns the file containing the client's private key.

Returns
string
string mqtt::ssl_options::get_private_key_password ( ) const
inline

Returns the password to load the client's privateKey if encrypted.

Returns
string
string mqtt::ssl_options::get_trust_store ( ) const
inline

Returns the file containing the public digital certificates trusted by the client.

Returns
string
ssl_options& mqtt::ssl_options::operator= ( const ssl_options opt)

Copy assignment.

Parameters
optThe other options to copy.
Returns
A reference to this object.
ssl_options& mqtt::ssl_options::operator= ( ssl_options &&  opt)

Move assignment.

Parameters
optThe other options to move to this one.
Returns
A reference to this object.
void mqtt::ssl_options::set_enable_server_cert_auth ( bool  enablServerCertAuth)

Enables or disables verification of the server certificate.

Parameters
enablServerCertAuthenable/disable verification of the server certificate
void mqtt::ssl_options::set_enabled_cipher_suites ( const string &  enabledCipherSuites)

Sets the list of cipher suites that the client will present to the server during the SSL handshake.

Parameters
enabledCipherSuitesThe list of cipher suites that the client will present to the server during the SSL handshake. For a full explanation of the cipher list format, please see the OpenSSL on-line documentation: http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT If this setting is ommitted, its default value will be "ALL", that is, all the cipher suites -excluding those offering no encryption- will be considered. This setting can be used to set an SSL anonymous connection (empty string value, for instance).
void mqtt::ssl_options::set_key_store ( const string &  keyStore)

Sets the file containing the public certificate chain of the client.

Parameters
keyStoreThe file in PEM format containing the public certificate chain of the client. It may also include the client's private key.
void mqtt::ssl_options::set_private_key ( const string &  privateKey)

Sets the file containing the client's private key.

Parameters
privateKeyIf not included in the sslKeyStore, this is the file in PEM format containing the client's private key.
void mqtt::ssl_options::set_private_key_password ( const string &  privateKeyPassword)

Sets the password to load the client's privateKey if encrypted.

Parameters
privateKeyPasswordThe password to load the privateKey if encrypted.
void mqtt::ssl_options::set_trust_store ( const string &  trustStore)

Sets the file containing the public digital certificates trusted by the client.

Parameters
trustStoreThe file in PEM format containing the public digital certificates trusted by the client.

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