<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93211/modem-certificate-management-from-zephyr-shell-cli</link><description>Hi, I want to update the AWS certificate for Device from CLI at time of Production. They files including Amazon root Certificate ,Client Cert and Private key are in PEM format. I am using at Wrapper for using AT commands in Zephyr Shell. I am unable to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Jan 2023 22:38:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93211/modem-certificate-management-from-zephyr-shell-cli" /><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/406356?ContentTypeID=1</link><pubDate>Tue, 24 Jan 2023 22:38:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:111fa10c-4866-4809-b72a-4dab69eb0b0f</guid><dc:creator>RileyH</dc:creator><description>&lt;p&gt;We are dealing with a similar issue. We are able to write the certificates/keys if we use the clear AT command (not running from within the shell). Once we enable the shell, the shell processing messes things up.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am wondering if the command: at at_cmd_mode would help to start it up in AT mode only. I looks to me that&amp;#39;s why this mode was created in the first place.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We haven&amp;#39;t yet moved forward to the newer versions of the SDK but this might provide enough reasons to move forward.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Anybody have thoughts on this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/394013?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 18:47:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3570f978-7d0f-4701-aec8-8c34462e362a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ERASE_ALL means that you&amp;#39;re clearing the flash entirely. You can read more about the highlevel API here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/pynrfjprog/blob/8bdced58d100191b6acd70904a2dd08b4257bc78/pynrfjprog/docs/highlevelnrfjprogdll.h#L930-L967"&gt;https://github.com/NordicSemiconductor/pynrfjprog/blob/8bdced58d100191b6acd70904a2dd08b4257bc78/pynrfjprog/docs/highlevelnrfjprogdll.h#L930-L967&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Waqar Ahmed"]At our production time .we are flashing the serial number in intel hex format like serial.hex file.&lt;br /&gt;before that we are flashing through SES download file option.[/quote]
&lt;p&gt;you can use nrfjprog directly for this purpose:&lt;/p&gt;
&lt;p&gt;nrfjprog --program my_file.hex --sectorerase --verify&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/393700?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 14:29:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16e66b0e-a1b4-41ec-958d-c4500b9a4443</guid><dc:creator>Waqar Ahmed</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I used this api.&lt;/p&gt;
&lt;p&gt;At our production time .we are flashing the serial number in intel hex format like serial.hex file.&lt;br /&gt;before that we are flashing through SES download file option.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I create a script&amp;nbsp; in the following order&lt;br /&gt;Flash serial number&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;program_options = HighLevel.ProgramOptions(&lt;br /&gt;    &lt;span&gt;erase_action&lt;/span&gt;=HighLevel.EraseAction.ERASE_NONE&lt;span&gt;,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;reset&lt;/span&gt;=HighLevel.ResetAction.RESET_NONE&lt;span&gt;,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;verify&lt;/span&gt;=HighLevel.VerifyAction.VERIFY_NONE&lt;br /&gt;)&lt;br /&gt;    nrfjprog_probe.program(fw_hex&lt;span&gt;, &lt;/span&gt;&lt;span&gt;program_options&lt;/span&gt;=program_options)&lt;br /&gt;&lt;br /&gt;Then Flash at_Client app&lt;br /&gt;&lt;br /&gt;with following program option &lt;/pre&gt;
&lt;pre&gt;program_options = HighLevel.ProgramOptions(&lt;br /&gt;    &lt;span&gt;erase_action&lt;/span&gt;=HighLevel.EraseAction.ERASE_ALL&lt;span&gt;,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;reset&lt;/span&gt;=HighLevel.ResetAction.SYSTEM_RESET&lt;span&gt;,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;verify&lt;/span&gt;=HighLevel.VerifyAction.VERIFY_READ&lt;br /&gt;)&lt;br /&gt;and then certification that flash successfully&lt;br /&gt;in the last stage i am going to flash the application firmware.&lt;/pre&gt;
&lt;pre&gt;program_options = HighLevel.ProgramOptions(&lt;br /&gt;    &lt;span&gt;erase_action&lt;/span&gt;=HighLevel.EraseAction.ERASE_ALL&lt;span&gt;,##not sured about this option&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;reset&lt;/span&gt;= HighLevel.ResetAction.SYSTEM_RESET&lt;span&gt;,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;verify&lt;/span&gt;=HighLevel.VerifyAction.VERIFY_READ&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;after completing above step I want to flash firmware again its erase serial number from nvs storage.&lt;/pre&gt;
&lt;p&gt;if we&amp;nbsp; flash the application through SES or VS code its work properly.&lt;/p&gt;
&lt;p&gt;Please guide about this issue.&lt;br /&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392642?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 13:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f43f846-c128-4310-b243-fa4536ca333b</guid><dc:creator>Waqar Ahmed</dc:creator><description>&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;I will check it&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392637?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 13:18:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1978229e-5bad-40e8-813d-7d757a6839c5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you looked at this post? It seems to match your requirement in terms of automating the credentials part:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/automating-nrf91-tls-credential-management-via-serial-port-at-commands"&gt;Automating nRF91 TLS credential management via serial port AT commands&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that you&amp;#39;ll need to use AT_client (or set your device in AT mode somehow).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392550?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 09:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59109e79-85f2-4550-82c6-30cfaef1eca5</guid><dc:creator>Waqar Ahmed</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;Thanks&lt;/p&gt;
&lt;p&gt;This mean \r \n part of cert format.&lt;/p&gt;
&lt;p&gt;Is there any way to Paste the whole cert in Zephyr CLI(Shell).&lt;/p&gt;
&lt;p&gt;if I paste the whole cert without removing \r \n CLI treat new line as new command.&lt;br /&gt;as I see we can paste the whole cert in LTE link terminal and its work.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392545?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 08:56:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77c78e9b-3910-49b6-b786-ba7f7cb11619</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Waqar Ahmed"]&lt;p&gt;&lt;span&gt;Using following C# code i am removing carriage return and new line for file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; text.Replace(&amp;quot;\n&amp;quot;, &amp;quot;&amp;nbsp; &amp;quot;).Replace(&amp;quot;\r&amp;quot;, &amp;quot;&amp;nbsp; &amp;quot;);&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;the newline should still be there if you issue using either the C&amp;nbsp;API&amp;#39;s for issuing, or use the AT command.&lt;/p&gt;
&lt;p&gt;Example when using the API&amp;#39;s to issue a cert, it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.1.1/samples/nrf9160/https_client/cert/DigiCertGlobalRootCA.pem#L7-L28"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.1.1/samples/nrf9160/https_client/cert/DigiCertGlobalRootCA.pem#L7-L28&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a picture of how it looks when I issue the AWS Root CA from at_client:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1666774512520v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You can see the \r\n is present on each line.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392542?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 08:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8affdb30-27bf-4088-a45c-6c45c3ee8de6</guid><dc:creator>Waqar Ahmed</dc:creator><description>&lt;p&gt;&lt;span&gt;Just to verify the behavior here. The certificates are written OK, ie. AT%CMNG=... for CA/client/private keys are written successfully, but you cannot connect successfully?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, The response is OK. after each command.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Following format I am following with each command.&lt;br /&gt;AT%CMNG=0,sec_tag,0,&amp;quot;text&amp;quot; CA&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;AT%CMNG=0,sec_tag,1,&amp;quot;text&amp;quot; client Cert&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;AT%CMNG=0,sec_tag,2,&amp;quot;text&amp;quot; private key&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;I am using AT command terminal on LTE Link monitor.&lt;br /&gt;Using following C# code i am removing carriage return and new line for file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; text.Replace(&amp;quot;\n&amp;quot;, &amp;quot;&amp;nbsp; &amp;quot;).Replace(&amp;quot;\r&amp;quot;, &amp;quot;&amp;nbsp; &amp;quot;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you able to connect successfully if use the &amp;quot;at_client&amp;quot; to issue the certificates, and then flash your application?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;I am going to try through AT client application as well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392535?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 08:27:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:321fe3fd-4104-405a-8b57-4a2b10c67367</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Waqar Ahmed"]Even&amp;nbsp; i tried from LTE link command terminal AT%CMNG=0,sec_tag,0,&amp;quot;certficate text&amp;quot; for CA cert,and then in sequence for other&lt;br /&gt;I am getting the error at the time of connectivity aws connect error -95.[/quote]
&lt;p&gt;Just to verify the behavior here. The certificates are written OK, ie. AT%CMNG=... for CA/client/private keys are written successfully, but you cannot connect successfully?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to connect successfully if use the &amp;quot;at_client&amp;quot; to issue the certificates, and then flash your application?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392441?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 14:43:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0b42384-bf79-4307-9d2b-5ec304d137af</guid><dc:creator>Waqar Ahmed</dc:creator><description>&lt;p&gt;HI Hakon,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I tried every way but still no success,&lt;/p&gt;
&lt;p&gt;Even&amp;nbsp; i tried from LTE link command terminal AT%CMNG=0,sec_tag,0,&amp;quot;certficate text&amp;quot; for CA cert,and then in sequence for other&lt;br /&gt;I am getting the error at the time of connectivity aws connect error -95.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem Certificate Management from zephyr Shell(CLI)</title><link>https://devzone.nordicsemi.com/thread/392370?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 11:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6383c73c-1eb1-42b0-a4d7-1b63004bfce9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried the sequence mentioned in the modem shell documentation?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/modem_shell/README.html#getting-nrf9160-dk-out-of-the-box-and-to-nrf-cloud"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/modem_shell/README.html#getting-nrf9160-dk-out-of-the-box-and-to-nrf-cloud&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can see the raw format by checking the &amp;quot;terminal&amp;quot; window after writing the certs.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>