blob: 03a03d40c80a964d4e396eb7117eb956b57ebd39 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2019 NXP
This software is owned or controlled by NXP and may only be used
strictly in accordance with the applicable license terms. By expressly
accepting such terms or by downloading, installing, activating and/or
otherwise using the software, you are agreeing that you have read, and
that you agree to comply with and are bound by, such license terms. If
you do not agree to be bound by the applicable license terms, then you
may not retain, install, activate or otherwise use the software.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>5.3.8. Azure Demo for iMX Linux / Raspberry Pi &#8212; Plug &amp; Trust MW v03.00.05 documentation</title>
<link rel="stylesheet" href="../../../_static/bootstrap-sphinx.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../../_static/graphviz.css" />
<script id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/language_data.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="5.4.1. Greengrass Demo for Linux" href="../sss_pkcs11/Readme.html" />
<link rel="prev" title="5.3.7. Azure Demo for KSDK" href="../../ksdk/azure/Readme.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="../../../_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="../../../_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="../../../_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="../../../_static/bootstrap-sphinx.js "></script>
</head><body>
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../../toc.html"><span><img src="../../../_static/NXP_logo_JPG.jpg"></span>
MW</a>
<span class="navbar-text navbar-version pull-left"><b>v03.00.05</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="../../../toc.html">TOC <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../index.html">1. NXP Plug &amp; Trust Middleware</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../organization-of-documentation.html">1.1. Organization of Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../folder-structure.html">1.2. Folder Structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sw-prerequisites.html">1.3. List of Platform Prerequisites</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../changes/index.html">2. Changes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/pending.html">2.1. Pending Refactoring items</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/pending.html#known-limitations">2.2. Known limitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v03_00_05.html">2.3. Release <code class="docutils literal notranslate"><span class="pre">v03.00.05</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v03_00_04.html">2.4. Release <code class="docutils literal notranslate"><span class="pre">v03.00.04</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v03_00_03.html">2.5. Release <code class="docutils literal notranslate"><span class="pre">v03.00.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v03_00_02.html">2.6. Release <code class="docutils literal notranslate"><span class="pre">v03.00.02</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_16_01.html">2.7. Release <code class="docutils literal notranslate"><span class="pre">v02.16.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_16_00.html">2.8. Release <code class="docutils literal notranslate"><span class="pre">v02.16.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_15_00.html">2.9. Release <code class="docutils literal notranslate"><span class="pre">v02.15.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_14_00.html">2.10. Release <code class="docutils literal notranslate"><span class="pre">v02.14.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html">2.11. Release <code class="docutils literal notranslate"><span class="pre">v02.12.05</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html#release-v02-12-04">2.12. Release <code class="docutils literal notranslate"><span class="pre">v02.12.04</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html#release-v02-12-03">2.13. Release <code class="docutils literal notranslate"><span class="pre">v02.12.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html#release-v02-12-02">2.14. Release <code class="docutils literal notranslate"><span class="pre">v02.12.02</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html#release-v02-12-01">2.15. Release <code class="docutils literal notranslate"><span class="pre">v02.12.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_12_00.html#release-v02-12-00">2.16. Release <code class="docutils literal notranslate"><span class="pre">v02.12.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_11_03.html">2.17. Release <code class="docutils literal notranslate"><span class="pre">v02.11.03</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_11_01.html">2.18. Internal Release <code class="docutils literal notranslate"><span class="pre">v02.11.01</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_11_00.html">2.19. Release <code class="docutils literal notranslate"><span class="pre">v02.11.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_10_00.html">2.20. Release <code class="docutils literal notranslate"><span class="pre">v02.10.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_09_00.html">2.21. Release <code class="docutils literal notranslate"><span class="pre">v02.09.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_07_00.html">2.22. Release <code class="docutils literal notranslate"><span class="pre">v02.07.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_06_00.html">2.23. Release <code class="docutils literal notranslate"><span class="pre">v02.06.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_05_00_to_v02_03_00.html">2.24. Release <code class="docutils literal notranslate"><span class="pre">v02.05.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_05_00_to_v02_03_00.html#release-v02-04-00">2.25. Release <code class="docutils literal notranslate"><span class="pre">v02.04.00</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../changes/v02_05_00_to_v02_03_00.html#release-02-03-00">2.26. Release <code class="docutils literal notranslate"><span class="pre">02.03.00</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../stack/index.html">3. Plug &amp; Trust MW Stack</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/features.html">3.1. Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/features.html#plug-trust-mw-block-diagram">3.2. Plug &amp; Trust MW : Block Diagram</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss-apis.html">3.3. SSS APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/se05xfeatures.html">3.4. SSS APIs: SE051 vs SE050</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/param_checks.html">3.5. Parameter Check &amp; Conventions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/i2cm.html">3.6. I2CM / Secure Sensor</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/logging.html">3.7. Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/feature-file.html">3.8. Feature File - <code class="docutils literal notranslate"><span class="pre">fsl_sss_ftr.h</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/platf-scp-from-fs.html">3.9. Using Platform SCP Keys from File System</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/auth/auth-objects.html">3.10. Auth Objects</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/auth/auth-objects-userid.html">3.11. Auth Objects : UserID</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/auth/auth-objects-aeskey.html">3.12. Auth Objects : AESKey</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/auth/auth-objects-eckey.html">3.13. Auth Objects : ECKey</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/key-id-range.html">3.14. Key Id Range and Purpose</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/key-id-range.html#authentication-keys">3.15. Authentication Keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../stack/key-id-range.html#trust-provisioned-keyids">3.16. Trust provisioned KeyIDs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/ex/doc/puf-scp03.html">3.17. SCP03 with PUF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/doc/sss_heap_management.html">3.18. SSS Heap Management</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../building/index.html">4. Building / Compiling</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../building/windows.html">4.1. Windows Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../building/frdm-k64f-sdk.html">4.2. Import MCUXPresso projects from SDK</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../building/frdm-k64f-cmake.html">4.3. Freedom K64F Build (CMake - Advanced)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../building/imx6.html">4.4. i.MX Linux Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../building/rpi3.html">4.5. Raspberry Pi Build</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../building/cmake.html">4.6. CMake</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../scripts/cmake_options.html">4.7. CMake Options</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">5. Demo and Examples</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../index.html#demo-list">5.1. Demo List</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#sss-api-examples">5.2. SSS API Examples</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../index.html#cloud-demos">5.3. Cloud Demos</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#linux-specific-demos">5.4. Linux Specific Demos</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#opc-ua-example">5.5. OPC-UA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#arm-psa-example">5.6. ARM PSA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#se05x-examples">5.7. SE05X Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#openssl-examples">5.8. OpenSSL Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#tests-for-user-crypto">5.9. Tests for User Crypto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#nxpnfcrdlib-examples">5.10. NXPNFCRDLIB examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#ease-of-use-examples">5.11. Ease-of-Use examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#semslite-examples">5.12. Semslite examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#puf-examples">5.13. PUF examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../edgelock2go-agent.html">6. NXP EdgeLock 2GO Agent</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/introduction.html">6.1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/introduction.html#building-and-running-the-edgelock-2go-agent">6.2. Building and running the EdgeLock 2GO agent</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/introduction.html#datastore-keystore">6.3. Datastore / Keystore</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/introduction.html#connection-to-the-edgelock-2go-cloud-service">6.4. Connection to the EdgeLock 2GO cloud service</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/introduction.html#claim-codes">6.5. Claim Codes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/edgelock2go_agent_apis.html">6.6. API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../nxp_iot_agent/doc/readme_usage_examples.html">6.7. Usage Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../semslite/doc/index.html">7. SEMS Lite Agent</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_overview.html">7.1. SEMS Lite Overview (Only for SE051)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_package.html">7.2. Update Package</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_usage.html">7.3. SEMS Lite Agent Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_mgmt_api.html">7.4. SEMS Lite management APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_process.html">7.5. SEMS Lite Agent Package Load Process</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_api.html">7.6. APIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/sems_lite_known_issue.html">7.7. SEMS Lite Known Issue</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../semslite/doc/demo_update.html">7.8. SEMS Lite DEMOs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../plugins/index.html">8. Plugins / Add-ins</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/plugin/openssl/scripts/readme.html">8.1. Introduction on OpenSSL engine</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/plugin/mbedtls/scripts/readme.html">8.2. Introduction on mbedTLS ALT Implementation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/plugin/psa/Readme.html">8.3. Platform Security Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../plugins/akm.html">8.4. Android Key master</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../sss/plugin/open62541/readme.html">8.5. Introduction on Open62541 (OPC UA stack)</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../plugins/wifiEAP/wifiEAP.html">8.6. WiFi EAP Demo with Raspberry Pi3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../plugins/pkcs11.html">8.7. PKCS#11 Standalone Library</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cli-tool.html">9. CLI Tool</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/introduction.html">9.1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/block-diagram.html">9.2. Block Diagram</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/pre-steps.html">9.3. Steps needed before running <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/running.html">9.4. Running the <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> tool - Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/Provisioning/readme.html">9.5. CLI Provisioning</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/readme_usage_examples.html">9.6. Usage Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/cli_commands_list.html">9.7. List of <code class="docutils literal notranslate"><span class="pre">ssscli</span></code> commands</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/cli_data_format.html">9.8. CLI Data formats</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../pycli/doc/cli_object_policy.html">9.9. Object Policies Through ssscli</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/upload_se05x_using_pycli.html">9.10. Upload keys and certificates to SE05X using ssscli tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../a71ch.html">10. A71CH</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../a71ch/a71ch_sss.html">10.1. A71CH and SSS API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../a71ch/a71ch_miscellaneous.html">10.2. Miscellaneous</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../a71ch/a71ch_legacy_host_api.html">10.3. A71CH Legacy API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../a71ch/a71ch_legacy_hlse_api.html">10.4. A71CH Legacy HLSE (Generic) API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../a71ch/a71ch_configure_tool.html">10.5. A71CH Legacy Configure Tool</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../appendix.html">11. Appendix</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/glossary.html">11.1. Glossary</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/vcom.html">11.2. APDU Commands over VCOM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/vs2019-setup.html">11.3. Visual Studio 2019 Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/ide_mcux.html">11.4. Setting up MCUXPresso IDE</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../dev-platforms.html">11.5. Development Platforms</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/se_uid.html">11.6. How to get SE Platform Information and UID</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/version_info.html">11.7. Version Information</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../Certificate_Chains/Readme.html">11.8. Certificate Chains</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/rjct_server.html">11.9. JRCP_v1 Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/platfscp.html">11.10. Using own Platform SCP03 Keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../appendix/apdu_write_to_buffer.html">11.11. Write APDU to buffer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../api/api_list.html">11.12. Plug &amp; Trust MW APIs</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">5.3.8. Azure Demo for iMX Linux / Raspberry Pi</a><ul>
<li><a class="reference internal" href="#prerequisites">5.3.8.1. Prerequisites</a></li>
<li><a class="reference internal" href="#preparing-the-credentials-and-provisioning-the-secure-element">5.3.8.2. Preparing the credentials and Provisioning the secure element</a></li>
<li><a class="reference internal" href="#registering-device">5.3.8.3. Registering Device</a></li>
<li><a class="reference internal" href="#create-device-enrollment-in-azure-iot-hub-portal">5.3.8.4. Create device enrollment in azure IoT Hub portal</a></li>
<li><a class="reference internal" href="#uploading-root-certificates-to-iot-hub">5.3.8.5. Uploading root certificates to IoT Hub</a></li>
<li><a class="reference internal" href="#build-the-openssl-engine-optional">5.3.8.6. Build the OpenSSL engine [Optional]</a></li>
<li><a class="reference internal" href="#run-the-example">5.3.8.7. Run the example</a></li>
</ul>
</li>
</ul>
</ul>
</li>
<li>
<a href="../../ksdk/azure/Readme.html" title="Previous Chapter: 5.3.7. Azure Demo for KSDK"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; 5.3.7. Azure ...</span>
</a>
</li>
<li>
<a href="../sss_pkcs11/Readme.html" title="Next Chapter: 5.4.1. Greengrass Demo for Linux"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">5.4.1. Greeng... &raquo;</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary">
<div class="sidebar-header">
<h3>Plug &amp; Trust MW</h3>
</div>
<div class="row">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../index.html">1. NXP Plug &amp; Trust Middleware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../changes/index.html">2. Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../stack/index.html">3. Plug &amp; Trust MW Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../building/index.html">4. Building / Compiling</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">5. Demo and Examples</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../index.html#demo-list">5.1. Demo List</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#sss-api-examples">5.2. SSS API Examples</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../index.html#cloud-demos">5.3. Cloud Demos</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../../ksdk/aws_jitr/readme.html">5.3.1. AWS Demo for KSDK</a></li>
<li class="toctree-l3"><a class="reference internal" href="../aws/readme.html">5.3.2. AWS Demo for iMX Linux / RaspberryPi</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../ksdk/gcp/readme.html">5.3.3. GCP Demo for KSDK</a></li>
<li class="toctree-l3"><a class="reference internal" href="../gcp/readme.html">5.3.4. GCP Demo for iMX Linux / Raspberry Pi</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../ksdk/ibm_watson/Readme.html">5.3.5. IBM Watson Demo for KSDK</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ibm_watson_iot/readme.html">5.3.6. IBM Watson Demo for iMX Linux / Raspberry Pi</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../ksdk/azure/Readme.html">5.3.7. Azure Demo for KSDK</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">5.3.8. Azure Demo for iMX Linux / Raspberry Pi</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#linux-specific-demos">5.4. Linux Specific Demos</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#opc-ua-example">5.5. OPC-UA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#arm-psa-example">5.6. ARM PSA Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#se05x-examples">5.7. SE05X Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#openssl-examples">5.8. OpenSSL Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#tests-for-user-crypto">5.9. Tests for User Crypto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#nxpnfcrdlib-examples">5.10. NXPNFCRDLIB examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#ease-of-use-examples">5.11. Ease-of-Use examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#semslite-examples">5.12. Semslite examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../index.html#puf-examples">5.13. PUF examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../edgelock2go-agent.html">6. NXP EdgeLock 2GO Agent</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../semslite/doc/index.html">7. SEMS Lite Agent</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../plugins/index.html">8. Plugins / Add-ins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cli-tool.html">9. CLI Tool</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../a71ch.html">10. A71CH</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../appendix.html">11. Appendix</a></li>
</ul>
</div>
<div class="row">
<form class="form" action="../../../search.html" method="get">
<div class="form-group">
<label for="Search">Search:</label>
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="body col-md-9 content" role="main">
<div class="section" id="azure-demo-for-imx-linux-raspberry-pi">
<span id="linux-demos-azure"></span><h1><span class="section-number">5.3.8. </span>Azure Demo for iMX Linux / Raspberry Pi<a class="headerlink" href="#azure-demo-for-imx-linux-raspberry-pi" title="Permalink to this headline"></a></h1>
<p>This demo demonstrates connection to Azure IoTHub using pre-provisioned
device credentials and demonstrates publish/subscribe procedure using MQTT.</p>
<div class="section" id="prerequisites">
<h2><span class="section-number">5.3.8.1. </span>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p>Azure account</p></li>
<li><p>SD Card image with SE050 Middleware pre-installed. The application is
built on the iMX platform.</p></li>
<li><p>IMX6UL-EVK platform or Raspberry pi connected to the Internet</p></li>
</ul>
</div>
<div class="section" id="preparing-the-credentials-and-provisioning-the-secure-element">
<h2><span class="section-number">5.3.8.2. </span>Preparing the credentials and Provisioning the secure element<a class="headerlink" href="#preparing-the-credentials-and-provisioning-the-secure-element" title="Permalink to this headline"></a></h2>
<p>Use ssscli tool from iMX/Rpi platform</p>
<ol class="arabic">
<li><p>Complete <a class="reference internal" href="../../../pycli/doc/pre-steps.html#cli-doc-pre-steps"><span class="std std-numref">Section 9.3</span></a> <a class="reference internal" href="../../../pycli/doc/pre-steps.html#cli-doc-pre-steps"><span class="std std-ref">Steps needed before running ssscli tool</span></a></p></li>
<li><p>To create certificates on imx and Raspberry Pi, call:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> simw-top/pycli/Provisioning
python3 GenerateAZURECredentials.py
python3 ResetAndUpdate_AZURE.py
</pre></div>
</div>
</li>
<li><p>Certificates and Keys are generated at <code class="docutils literal notranslate"><span class="pre">simw-top/pycli/Provisioning/azure</span></code></p></li>
</ol>
</div>
<div class="section" id="registering-device">
<h2><span class="section-number">5.3.8.3. </span>Registering Device<a class="headerlink" href="#registering-device" title="Permalink to this headline"></a></h2>
<p>To register the device onto the IoT Hub portal, we can either upload Root credentials manually
or we can register an individual device using <code class="docutils literal notranslate"><span class="pre">azure_imx_register</span></code> application. If you wish
to upload Root credentials, skip the next steps and proceed to <a class="reference internal" href="#azure-imx-upload-root"><span class="std std-ref">Uploading root certificates to IoT Hub</span></a>.</p>
</div>
<div class="section" id="create-device-enrollment-in-azure-iot-hub-portal">
<span id="azure-register-device"></span><h2><span class="section-number">5.3.8.4. </span>Create device enrollment in azure IoT Hub portal<a class="headerlink" href="#create-device-enrollment-in-azure-iot-hub-portal" title="Permalink to this headline"></a></h2>
<p><strong>This step is only for individual device enrollment.</strong></p>
<p>Prerequisite: Azure IOT hub and Azure IOT HUB DPS account which are linked.</p>
<p>Refer: <a class="reference external" href="https://docs.microsoft.com/en-us/azure/iot-dps/tutorial-set-up-cloud">https://docs.microsoft.com/en-us/azure/iot-dps/tutorial-set-up-cloud</a></p>
<p><a class="reference external" href="https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision">https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision</a></p>
<p>Once required accounts exist we can enroll the devices.
For this we only need device certificate which we created in above steps.</p>
<p>Follow the steps to enroll the device: <a class="reference external" href="https://docs.microsoft.com/en-us/azure/iot-dps/tutorial-provision-device-to-hub">https://docs.microsoft.com/en-us/azure/iot-dps/tutorial-provision-device-to-hub</a></p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>When creating device certificates be sure to use only lower-case alphanumerics and hyphens in your device name.</p>
</div>
<p>Run <code class="docutils literal notranslate"><span class="pre">azure_imx_register</span></code> application to register the device onto your IoT Hub.</p>
<p><code class="docutils literal notranslate"><span class="pre">azure_imx_register</span></code> application can take parameters either via JSON file or via command line.
The required parameters are:</p>
<ul class="simple">
<li><p>registerid: Registration id of the device (common name of device certificate)</p></li>
<li><p>keypath: Path to reference key pem file</p></li>
<li><p>devcert: Path to device certificate</p></li>
<li><p>rootpath: Path to azure root CA certificate</p></li>
<li><p>idscope: IDScope (can found in Azure IoT-DPS account - Overview)</p></li>
</ul>
<p>Run via command line as:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>./azure_imx_register --registerid test-device --keypath keyref.pem --rootpath azureRootCA.pem --devcert cert.pem --idscope 0ne00068F95
</pre></div>
</div>
<p>Or pass JSON file as:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>./azure_imx_register --json json_register_config.json
</pre></div>
</div>
<p>Sample JSON file:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="o">{</span>
<span class="s2">&quot;devcert&quot;</span>: <span class="s2">&quot;cert.pem&quot;</span>,
<span class="s2">&quot;keypath&quot;</span>: <span class="s2">&quot;keyref.pem&quot;</span>,
<span class="s2">&quot;id_scope&quot;</span>: <span class="s2">&quot;0ne00068F95&quot;</span>,
<span class="s2">&quot;registration_id&quot;</span>: <span class="s2">&quot;test-device&quot;</span>,
<span class="s2">&quot;rootpath&quot;</span>: <span class="s2">&quot;azureRootCA.pem&quot;</span>
<span class="o">}</span>
</pre></div>
</div>
<p>Upon successful registration, “DeviceID”.txt file is created with DeviceID, assigned hub along with keyref, device certificate and root certificate path.
This file can be given as input to connect to device and send messages.</p>
<p>The device is now registered and appears on IoT Azure hub under devices tab</p>
<p>We can pass this JSON file to <code class="docutils literal notranslate"><span class="pre">azure_imx_connect</span></code> application to connect to IoT Hub. You can skip the next step and proceed to <a class="reference internal" href="#azure-openssl-build"><span class="std std-ref">Build the OpenSSL engine [Optional]</span></a>.</p>
</div>
<div class="section" id="uploading-root-certificates-to-iot-hub">
<span id="azure-imx-upload-root"></span><h2><span class="section-number">5.3.8.5. </span>Uploading root certificates to IoT Hub<a class="headerlink" href="#uploading-root-certificates-to-iot-hub" title="Permalink to this headline"></a></h2>
<ol class="arabic">
<li><p>On Azure IoT Hub portal, Navigate to <code class="docutils literal notranslate"><span class="pre">Dashboard</span> <span class="pre">--&gt;</span> <span class="pre">&lt;Your</span> <span class="pre">IoT</span> <span class="pre">Hub&gt;</span> <span class="pre">--&gt;</span> <span class="pre">Certificates</span></code>. Click on Add</p></li>
<li><p>Enter a friendly name and upload the root certificate created in the previous step. Location - <code class="docutils literal notranslate"><span class="pre">simw-top/pycli/Provisioning/azure/RootCA.cer</span></code> -&gt; Save</p></li>
<li><p>Your certificate will show in the Certificate Explorer list. Click on certificate added</p></li>
<li><p>In Certificate Details, click Generate Verification Code</p></li>
<li><p>The provisioning service creates a Verification Code that you can use to validate the certificate ownership. Copy the code to your clipboard</p></li>
<li><p>Use the verification_certificate.py to generate a verify certificate (verifyCert4.cer)</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> simw-top/pycli/Provisioning
python verification_certificate.py &lt;RootCA_Certificate&gt; &lt;RootCA_Keypair&gt; &lt;Verification Code&gt;
</pre></div>
</div>
</li>
<li><p>On <code class="docutils literal notranslate"><span class="pre">Azure</span> <span class="pre">portal</span> <span class="pre">-&gt;</span> <span class="pre">Certificate</span> <span class="pre">Details</span></code>, upload the verifyCert4.cer file generated and click Verify.</p>
<p>STATUS of your certificate should change to <code class="docutils literal notranslate"><span class="pre">Verified</span></code> in the Certificate Explorer list</p>
</li>
</ol>
</div>
<div class="section" id="build-the-openssl-engine-optional">
<span id="azure-openssl-build"></span><h2><span class="section-number">5.3.8.6. </span>Build the OpenSSL engine [Optional]<a class="headerlink" href="#build-the-openssl-engine-optional" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This step is optional in case you are using a prepared
SD card image from NXP.</p>
</div>
<p>The OpenSSL engine uses the sss abstraction layer to access the crypto
services of the secure element, the implementation remains dependent on
the secure element attached. The following illustrates compiling the
OpenSSL engine for SE050 connected over I2C.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> simw-top
python scripts/create_cmake_projects.py
<span class="nb">cd</span> ../simw-top_build/imx_native_se050_t1oi2c
cmake --build .
make install
ldconfig /usr/local/lib
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Replace <code class="docutils literal notranslate"><span class="pre">imx_native_se050_t1oi2c</span></code> with <code class="docutils literal notranslate"><span class="pre">raspbian_native_se050_t1oi2c</span></code>
when building for Raspberry Pi.</p>
</div>
</div>
<div class="section" id="run-the-example">
<h2><span class="section-number">5.3.8.7. </span>Run the example<a class="headerlink" href="#run-the-example" title="Permalink to this headline"></a></h2>
<ol class="arabic">
<li><p>Use ‘buildScript.sh’ script at simw-top/demos/linux/azure/ to download all dependencies and build the mqtt application for azure call:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span> /simw-top/demos/linux/azure
./buildScript.sh
</pre></div>
</div>
</li>
<li><p>Based on OpenSSL version and applicable Secure Element, select the appropriate configuration file in
<code class="docutils literal notranslate"><span class="pre">&lt;MW_SRC_DIR&gt;/simw-top/demos/linux/common</span></code> directory:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>openssl11_sss_a71ch.cnf ----- OpenSSL <span class="m">1</span>.1.1 and A71CH
openssl11_sss_se050.cnf ----- OpenSSL <span class="m">1</span>.1.1 and SE050
openssl_sss_a71ch.cnf ----- OpenSSL <span class="m">1</span>.0.0 and A71CH
openssl_sss_se050.cnf ----- OpenSSL <span class="m">1</span>.0.0 and SE050
</pre></div>
</div>
</li>
<li><p>Set the openssl config path as call:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">OPENSSL_CONF</span><span class="o">=</span>/simw-top/demos/linux/common/&lt;appropriate-cnf-file&gt;
</pre></div>
</div>
</li>
<li><p>To run the application, call:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>$ ./azure_imx_connect --deviceid <span class="s2">&quot;&lt;devive_name&gt;&quot;</span> --keypath simw-top/pycli/Provisioning/azure/&lt;UID&gt;_device_reference_key.pem --rootpath simw-top/demos/linux/azure/azureRootCA.pem --devcert simw-top/pycli/Provisioning/azure/&lt;UID&gt;_device_certificate.cer --hubname &lt;IotHubName&gt;.azure-devices.net --username &lt;IotHubName&gt; --payload <span class="s2">&quot;&lt;MESSAGE&gt;&quot;</span>
</pre></div>
</div>
<p>Or pass JSON file as:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>./azure_imx_connect --json json_connect_config.json
</pre></div>
</div>
<p>Sample json_connect_config.json:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="o">{</span>
<span class="s2">&quot;assignedHub&quot;</span>: <span class="s2">&quot;ABCD.azure-devices.net&quot;</span>,
<span class="s2">&quot;deviceId&quot;</span>: <span class="s2">&quot;test-device&quot;</span>,
<span class="s2">&quot;registration_id&quot;</span>: <span class="s2">&quot;test-device&quot;</span>,
<span class="s2">&quot;status&quot;</span>: <span class="s2">&quot;assigned&quot;</span>,
<span class="s2">&quot;keypath&quot;</span>: <span class="s2">&quot;keyref.pem&quot;</span>,
<span class="s2">&quot;devcert&quot;</span>: <span class="s2">&quot;cert.pem&quot;</span>,
<span class="s2">&quot;rootpath&quot;</span>: <span class="s2">&quot;azureRootCA.pem&quot;</span>,
<span class="s2">&quot;payload&quot;</span>: <span class="s2">&quot;hello message from device test-device&quot;</span>
<span class="o">}</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you have used <code class="docutils literal notranslate"><span class="pre">azure_imx_register</span></code> application, <code class="docutils literal notranslate"><span class="pre">json_connect_config.json</span></code> is same as <code class="docutils literal notranslate"><span class="pre">&quot;DeviceID&quot;.txt</span></code></p>
</div>
</li>
</ol>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ol class="arabic simple">
<li><p>Export the OpenSSL conf path to the exact location of the file. The above example is for illustrative purpose</p></li>
<li><p>While executing the application, use the appropriate values for device cert, Device id, Path, hubname and username</p></li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2018-2020, NXP.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.1.<br/>
</p>
</div>
</footer>
</body>
</html>