<?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>Is there a way to read out the Common Name from a device certificate?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56705/is-there-a-way-to-read-out-the-common-name-from-a-device-certificate</link><description>For purposes of provisioning a device, it would be handy to be able to read out the Subject common name from the device certificate. You can&amp;#39;t read the device cert from the application processor. Is there a way to cause the modem to parse the cert and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jan 2020 17:12:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56705/is-there-a-way-to-read-out-the-common-name-from-a-device-certificate" /><item><title>RE: Is there a way to read out the Common Name from a device certificate?</title><link>https://devzone.nordicsemi.com/thread/231252?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 17:12:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4537057a-e223-4b4e-b675-7415bfa2dad7</guid><dc:creator>JVantol</dc:creator><description>&lt;p&gt;Actually it turns out I don&amp;#39;t need this. I wound up using the PSK identity slot to store my device name, and that works great.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to read out the Common Name from a device certificate?</title><link>https://devzone.nordicsemi.com/thread/230307?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 11:08:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3561e7bf-d6c0-41dd-a30d-b170c57c9cf7</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi, you are correct, sorry about the misinformation.&amp;nbsp;You cannot use %CMNG to read out certificate types 1,2, and 3 (client certificate, client private key and pre-shared key). This is for security reasons.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]could something like this get added to the SDK at some point?[/quote]
&lt;p&gt;&amp;nbsp;It could, but it is very unlikely as this was done intentionally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps an application that stores the information to flash, when the certificates are being written to the modem is the best way to do this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can I ask why you need this feature?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to read out the Common Name from a device certificate?</title><link>https://devzone.nordicsemi.com/thread/230130?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 15:35:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:754295d3-d19f-4a2a-923a-35292cabbad3</guid><dc:creator>JVantol</dc:creator><description>&lt;p&gt;Heidi, I tried it, it didn&amp;#39;t work. You can read the CA cert, but not the device cert. Perhaps this isn&amp;#39;t the intended behavior, but it&amp;#39;s what happens. The response length is set to 4k, just to make sure. I know which cert I put in, and it should easily fit in 4k.&lt;/p&gt;
&lt;p&gt;If you read the CA cert with, for example AT%CMNG=2, 12345678, 0 you get the expected result. Trying the same on the device cert by issuing AT%CMNG=2, 12345678, 1 results in this response:&lt;/p&gt;
&lt;pre style="background-color:#000000;border:initial;border-radius:initial;color:#72b3cf;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;[00:03:26.627,197] &lt;/pre&gt;
&lt;pre class="ctrl-char ESC" style="background-color:#000000;border:initial;border-radius:initial;color:#72b3cf;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;&lt;/pre&gt;
&lt;pre style="background-color:#000000;border:initial;border-radius:initial;color:#72b3cf;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;[1;31m&amp;lt;err&amp;gt; at_host: Error while processing AT command: -8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to read out the Common Name from a device certificate?</title><link>https://devzone.nordicsemi.com/thread/230052?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 12:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a61362a3-5ffd-4be9-bb4d-985a5bb9d43f</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]You can&amp;#39;t read the device cert from the application processor.[/quote]
&lt;p&gt;&amp;nbsp;This is incorrect. Using the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/at_cmd.html"&gt;AT command interface&lt;/a&gt;&amp;nbsp;in NCS, you can use the %CMNG command to read out the certificates and then parse it in your application. Make sure to change the&amp;nbsp;&lt;span&gt;AT_CMD_RESPONSE_MAX_LEN config&lt;/span&gt;&amp;nbsp;to&amp;nbsp;at least 3k (it defaults to 2.7 kB).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>