1717 - [ Direct MQTT with Custom Authentication] ( #direct-mqtt-with-custom-authentication )
1818 - [ MQTT over Websockets with Cognito] ( #mqtt-over-websockets-with-cognito )
1919 - [ Direct MQTT with Windows Certificate Store Method] ( #direct-mqtt-with-windows-certificate-store-method )
20- - [ Direct MQTT with PKCS11 Method] ( #direct-mqtt-with-pkcs11-method )
21- - [ Direct MQTT with pkcs12 method] ( #direct-mqtt-with-pkcs12-method )
20+ - [ Direct MQTT with PKCS11 Method (Unix Only) ] ( #direct-mqtt-with-pkcs11-method-unix-only )
21+ - [ Direct MQTT with pkcs12 method (macOS Only) ] ( #direct-mqtt-with-pkcs12-method-macos-only )
2222 + [ Adding an HTTP Proxy] ( #adding-an-http-proxy )
2323 + [ Client Operations] ( #client-operations )
2424 - [ Subscribe] ( #subscribe )
@@ -81,7 +81,7 @@ Example:
8181 std::shared_ptr<Mqtt5Client > client = nullptr;
8282
8383 // Create Mqtt5Client Builder
84- Aws::Iot::Mqtt5ClientBuilder * builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath (...);
84+ std::shared_ptr< Aws::Iot::Mqtt5ClientBuilder> builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath (...);
8585
8686 // Setup lifecycle callbacks
8787 builder->WithClientConnectionSuccessCallback(
@@ -115,10 +115,10 @@ Once a MQTT5 client builder has been created, it is ready to make a [MQTT5 clien
115115``` cpp
116116
117117 // Create Mqtt5Client Builder
118- Aws::Iot::Mqtt5ClientBuilder * builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath (...);
118+ std::shared_ptr< Aws::Iot::Mqtt5ClientBuilder> builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath (...);
119119
120120 // Build Mqtt5Client
121- std::shared_ptr<Aws::Crt::Mqtt5Client> client = builder->Build ();
121+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> client = builder->Build ();
122122
123123 if (mqtt5Client == nullptr )
124124 {
@@ -142,7 +142,7 @@ The MQTT5 client emits a set of events related to state and network status chang
142142```cpp
143143
144144 // Create Mqtt5Client Builder
145- Aws::Iot::Mqtt5ClientBuilder * builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath (...);
145+ std::shared_ptr< Aws::Iot::Mqtt5ClientBuilder> builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath (...);
146146
147147
148148 /* setup lifecycle event callbacks */
@@ -181,7 +181,7 @@ The MQTT5 client emits a set of events related to state and network status chang
181181 });
182182
183183 // Build Mqtt5Client
184- std::shared_ptr<Aws::Crt::Mqtt5Client> client = builder->Build();
184+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> client = builder->Build();
185185
186186 if (mqtt5Client == nullptr)
187187 {
@@ -253,7 +253,7 @@ Emitted once the client has shutdown any associated network connection and enter
253253
254254``` cpp
255255 // Create Mqtt5Client Builder
256- Aws::Iot::Mqtt5ClientBuilder * builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath (...);
256+ std::shared_ptr< Aws::Iot::Mqtt5ClientBuilder> builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath (...);
257257
258258 builder->WithPublishReceivedCallback ([ ] (const Mqtt5::PublishReceivedEventData &eventData) {
259259 if (eventData.publishPacket == nullptr)
@@ -263,7 +263,7 @@ Emitted once the client has shutdown any associated network connection and enter
263263 fprintf(stdout, "\n");
264264 });
265265
266- std::shared_ptr<Aws::Crt::Mqtt5Client> client = builder->Build();
266+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> client = builder->Build();
267267```
268268
269269
@@ -277,10 +277,10 @@ Invoking `start()` on the client will put it into an active state where it recur
277277```cpp
278278
279279 // Create Mqtt5Client Builder
280- Aws::Iot::Mqtt5ClientBuilder * builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath (...);
280+ std::shared_ptr< Aws::Iot::Mqtt5ClientBuilder> builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath (...);
281281
282282 // Build Mqtt5Client
283- std::shared_ptr<Aws::Crt::Mqtt5Client> client = builder->Build();
283+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> client = builder->Build();
284284
285285 if (mqtt5Client == nullptr)
286286 {
@@ -322,16 +322,17 @@ For X509 based mutual TLS, you can create a client where the certificate and pri
322322
323323```cpp
324324 // Create a Client using Mqtt5ClientBuilder
325- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsFromPath(
326- "<clientEndpoint>", "<certificateFilePath>", "<privateKeyFilePath>");
325+ std::shared_ptr<Aws::Iot::Mqtt5ClientBuilder> builder =
326+ Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsFromPath(
327+ "<clientEndpoint>", "<certificateFilePath>", "<privateKeyFilePath>");
327328
328329 /* You can setup other client options and lifecycle event callbacks before call builder->Build().
329330 ** Once the the client get built, you could no longer update the client options or connection options
330331 ** on the created client.
331332 */
332333
333334 // Build Mqtt5Client
334- std::shared_ptr<Aws::Crt::Mqtt5Client> client = builder->Build();
335+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> client = builder->Build();
335336
336337 if (client == nullptr)
337338 {
@@ -369,16 +370,17 @@ If the default credentials provider chain and AWS region are specified, you do n
369370 Aws::Iot::WebsocketConfig websocketConfig(<signing region >, provider);
370371
371372 // Create a Client using Mqtt5ClientBuilder
372- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWebsocket(
373- "<clientEndpoint>", websocketConfig);
373+ std::shared_ptr<Aws::Iot::Mqtt5ClientBuilder> builder =
374+ Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithWebsocket (
375+ "<clientEndpoint>", websocketConfig);
374376
375377 /* You can setup other client options and lifecycle event callbacks before call builder->Build().
376378 ** Once the the client get built, you could no longer update the client options or connection options
377379 ** on the created client.
378380 */
379381
380382 // Build Mqtt5Client
381- std::shared_ptr<Aws::Crt::Mqtt5Client> mqtt5Client = builder->Build();
383+ std::shared_ptr<Aws::Crt::Mqtt5:: Mqtt5Client> mqtt5Client = builder->Build();
382384
383385 if (mqtt5Client == nullptr)
384386 {
@@ -406,7 +408,7 @@ If your custom authenticator does not use signing, you don't specify anything re
406408 customAuth.WithPassword(<Binary data value of the password field to be passed to the authorizer lambda>);
407409
408410 // Create a Client using Mqtt5ClientBuilder
409- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithCustomCustomAuthorizer (
411+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithCustomAuthorizer (
410412 "<clientEndpoint>", customAuth);
411413
412414 /* You can setup other client options and lifecycle event callbacks before call builder->Build().
@@ -437,7 +439,7 @@ If your custom authorizer uses signing, you must specify the three signed token
437439 customAuth.WithTokenSignature(" <The signature of the custom authorizer>" )
438440
439441 // Create a Client using Mqtt5ClientBuilder
440- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithCustomCustomAuthorizer (
442+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithCustomAuthorizer (
441443 " <clientEndpoint>" , customAuth);
442444
443445 /* You can setup other client options and lifecycle event callbacks before call builder->Build().
@@ -495,7 +497,7 @@ To create a MQTT5 builder configured for this connection, see the following code
495497 Aws::Iot::WebsocketConfig websocketConfig(<signing region>, provider);
496498
497499 // Create a Client using Mqtt5ClientBuilder
498- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWebsocket (
500+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithWebsocket (
499501 "<clientEndpoint>", websocketConfig);
500502
501503 /* You can setup other client options and lifecycle event callbacks before call builder->Build().
@@ -524,7 +526,7 @@ store, rather than simply being files on disk. To create a MQTT5 builder configu
524526``` cpp
525527 String windowsCertPath = " CurrentUser\\ MY\\ A11F8A9B5DF5B98BA3508FBCA575D09570E0D2C6" ;
526528
527- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithWindowsCertStorePath (
529+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithWindowsCertStorePath (
528530 " <clientEndpoint>" , windowsCertPath);
529531
530532 // Build Mqtt5Client
@@ -545,7 +547,7 @@ store, rather than simply being files on disk. To create a MQTT5 builder configu
545547Note: This is the primary way to use HSM/TPMs on Windows.
546548Note: Windows Certificate Store connection support is only available on Windows devices.
547549
548- ### Direct MQTT with PKCS11 Method
550+ ### Direct MQTT with PKCS11 Method (Unix Only)
549551
550552A MQTT5 direct connection can be made using a PKCS11 device rather than using a PEM encoded private key,
551553the private key for mutual TLS is stored on a PKCS#11 compatible smart card or Hardware Security Module (HSM).
@@ -564,7 +566,7 @@ the private key for mutual TLS is stored on a PKCS#11 compatible smart card or H
564566 pkcs11Options.SetTokenLabel("<pkcs11_tokenLabel>");
565567 pkcs11Options.SetPrivateKeyObjectLabel("<pkcs11_privateKeyLabel>");
566568
567- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsPkcs11 (
569+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsPkcs11 (
568570 "<endpoint>", pkcs11Options);
569571
570572 builder->WithPort(8883);
@@ -581,15 +583,15 @@ the private key for mutual TLS is stored on a PKCS#11 compatible smart card or H
581583```
582584Note: Currently, TLS integration with PKCS #11 is only available on Unix devices.
583585
584- ### Direct MQTT with PKCS12 Method
586+ ### Direct MQTT with PKCS12 Method (macOS Only)
585587A MQTT5 direct connection can be made using a PKCS12 file rather than using a PEM encoded private key.
586588To create a MQTT5 builder configured for this connection, see the following code:
587589``` cpp
588590 Aws::Iot::Pkcs12Options testPkcs12Options;
589591 testPkcs12Options.pkcs12_file = " <pkcs12_key>" ;
590592 testPkcs12Options.pkcs12_password = " <pkcs12_password>" ;
591593
592- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithMtlsPkcs12 (
594+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithMtlsPkcs12 (
593595 " <endpoint>" , testPkcs12Options);
594596
595597 std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> mqtt5Client = builder->Build ();
@@ -609,7 +611,7 @@ No matter what your connection transport or authentication method is, you may co
609611
610612```cpp
611613 // Create a Client using Mqtt5ClientBuilder
612- Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::NewMqtt5ClientBuilderWithXXXXX ( ... );
614+ Aws::Iot::Mqtt5ClientBuilder *builder = Aws::Iot::Mqtt5ClientBuilder::CreateMqtt5ClientBuilderWithXXXXX ( ... );
613615
614616 Http::HttpClientConnectionProxyOptions proxyOptions;
615617 proxyOptions.HostName = "<proxyHost>";
0 commit comments