25 #ifndef __mqtt_ssl_options_h
26 #define __mqtt_ssl_options_h
28 #include "MQTTAsync.h"
44 static const MQTTAsync_SSLOptions DFLT_C_STRUCT ;
47 MQTTAsync_SSLOptions opts_;
62 string privateKeyPassword_;
68 string enabledCipherSuites_;
72 friend class connect_options_test;
73 friend class ssl_options_test;
85 const char* c_str(
const string& str) {
86 return str.empty() ?
nullptr : str.c_str();
91 void update_c_struct();
95 using ptr_t = std::shared_ptr<ssl_options>;
117 ssl_options(
const string& trustStore,
const string& keyStore,
118 const string& privateKey,
const string& privateKeyPassword,
119 const string& enabledCipherSuites,
bool enableServerCertAuth);
174 return to_bool(opts_.enableServerCertAuth);
238 #endif // __mqtt_ssl_options_h
ssl_options()
Constructs a new MqttConnectOptions object using the default values.
string get_trust_store() const
Returns the file containing the public digital certificates trusted by the client.
Definition: ssl_options.h:147
Basic types and type conversions for the Paho MQTT C++ library.
Holds the set of SSL options for connection.
Definition: ssl_options.h:41
string get_private_key_password() const
Returns the password to load the client's privateKey if encrypted.
Definition: ssl_options.h:162
void set_enable_server_cert_auth(bool enablServerCertAuth)
Enables or disables verification of the server certificate.
Holds the set of options that control how the client connects to a server.
Definition: connect_options.h:46
Declaration of MQTT message class.
bool get_enable_server_cert_auth() const
Returns the true/false to enable verification of the server certificate .
Definition: ssl_options.h:173
void set_key_store(const string &keyStore)
Sets the file containing the public certificate chain of the client.
void set_private_key_password(const string &privateKeyPassword)
Sets the password to load the client's privateKey if encrypted.
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...
std::shared_ptr< const ssl_options > const_ptr_t
Smart/shared pointer to a const object of this class.
Definition: ssl_options.h:97
void set_trust_store(const string &trustStore)
Sets the file containing the public digital certificates trusted by the client.
string get_enabled_cipher_suites() const
Returns the list of cipher suites that the client will present to the server during the SSL handshake...
Definition: ssl_options.h:168
string get_private_key() const
Returns the file containing the client's private key.
Definition: ssl_options.h:157
string get_key_store() const
Returns the file containing the public certificate chain of the client.
Definition: ssl_options.h:152
ssl_options & operator=(const ssl_options &opt)
Copy assignment.
Declaration of MQTT topic class.
std::shared_ptr< ssl_options > ptr_t
Smart/shared pointer to an object of this class.
Definition: ssl_options.h:95
void set_private_key(const string &privateKey)
Sets the file containing the client's private key.