You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MQTT5-UserGuide.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@
20
20
*[Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls)
21
21
*[MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication)
22
22
*[Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication)
23
+
*[Direct MQTT with PKCS11](#direct-mqtt-with-pkcs11-method)
24
+
*[Direct MQTT with PKCS12](#direct-mqtt-with-pkcs12-method)
23
25
*[HTTP Proxy](#http-proxy)
24
26
*[Browser](#browser)
25
27
*[MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication-1)
@@ -267,6 +269,44 @@ token-signing fields to the value of the username that you assign within the cus
267
269
add any custom authentication related values to the username in the CONNECT configuration optionally attached to the client configuration.
268
270
The builder will do everything for you.
269
271
272
+
#### Direct MQTT with PKCS11 Method
273
+
274
+
A MQTT5 direct connection can be made using a PKCS11 device rather than using a PEM encoded private key, the private key for mutual TLS is stored on a PKCS#11 compatible smart card or Hardware Security Module (HSM). To create a MQTT5 builder configured for this connection, see the following code:
275
+
276
+
```typescript
277
+
let pkcs11Options :Pkcs11Options= {
278
+
pkcs11_lib: "<path to PKCS11 library>",
279
+
user_pin: "<Optional pin for PKCS11 device>",
280
+
slot_id: "<Optional slot ID containing PKCS11 token>",
281
+
token_label: "<Optional label of the PKCS11 token>",
282
+
private_key_object_label: "<Optional label of the private key object on the PKCS#11 token>",
283
+
cert_file_path: "<Path to certificate file. Not necessary if cert_file_contents is used>",
284
+
cert_file_contents: "<Contents of certificate file. Not necessary if cert_file_path is used>"
285
+
};
286
+
let builder =AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPkcs11(
287
+
"<account-specific endpoint>",
288
+
pkcs11Options
289
+
);
290
+
let client :Mqtt5Client=newmqtt5.Mqtt5Client(builder.build());
291
+
```
292
+
293
+
Note: Currently, TLS integration with PKCS#11 is only available on Unix devices.
294
+
295
+
#### Direct MQTT with PKCS12 Method
296
+
297
+
A MQTT5 direct connection can be made using a PKCS12 file rather than using a PEM encoded private key. To create a MQTT5 builder configured for this connection, see the following code:
298
+
299
+
```typescript
300
+
let builder =AwsIotMqtt5ClientConfigBuilder.newDirectMqttBuilderWithMtlsFromPkcs12(
301
+
"<account-specific endpoint>",
302
+
"<PKCS12 file>",
303
+
"<PKCS12 password>"
304
+
);
305
+
let client :Mqtt5Client=newmqtt5.Mqtt5Client(builder.build());
306
+
```
307
+
308
+
Note: Currently, TLS integration with PKCS#12 is only available on MacOS devices.
309
+
270
310
#### HTTP Proxy
271
311
No matter what your connection transport or authentication method is, you may connect through an HTTP proxy
0 commit comments