<?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>Verifying Public and Private Certificates</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93870/verifying-public-and-private-certificates</link><description>Hi all, 
 This is for nrf9160 with firmware version 1.3.1. 
 I &amp;#39;m trying to read back the certificates and comparing with a known CRC. 
 modem_key_mgmt_read is able to read the CA_CHAIN cert, but cannot read the Public_Cert and the Private_Cert. (retruns</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Mar 2025 21:02:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93870/verifying-public-and-private-certificates" /><item><title>RE: Verifying Public and Private Certificates</title><link>https://devzone.nordicsemi.com/thread/529382?ContentTypeID=1</link><pubDate>Thu, 27 Mar 2025 21:02:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e099ff7c-f7f1-452c-95af-3639dd79c0a8</guid><dc:creator>Manu</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I came across this thread because I was trying to&amp;nbsp;ensure that the&amp;nbsp;creds we generate ( externally)&amp;nbsp;are making it into the device properly.&lt;br /&gt;In doing so, I&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;found myself unable to generate(from the files I downloaded) a matching hash&amp;nbsp;for&amp;nbsp;the cert installed onto the device. ( Specifically, I expect to generate a hash to match what was written into slot 100, type 1.&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743109301438v1.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To my surprise, I noted that the hash I was able to generate for the ROOT_CA_CERT&amp;nbsp;MATCHES one of the (auto-installed?) type 10 credentials in the (default?) sec_slot.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743109310647v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;So, in summary,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;How do I generate the SHA key that the device&amp;nbsp;returns on a AT%CMNG=1, so I can verify the same key exists?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Any other information about what the autogenerated tags mean would also be illustrative&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Verifying Public and Private Certificates</title><link>https://devzone.nordicsemi.com/thread/396451?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2022 14:40:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff9d50c5-b078-4732-9206-7e4a5ccedbc6</guid><dc:creator>Raoul</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You will have to upgrade the modem firmware to the newest version, v1.3.2, and then &lt;code&gt;list&lt;/code&gt; these certificates to do your comparison.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;code&gt;MODEM_KEY_MGMT_CRED_TYPE_PUBLIC_CERT&lt;/code&gt; and &lt;code&gt;MODEM_KEY_MGMT_CRED_TYPE_PRIVATE_CERT&lt;/code&gt; can&amp;#39;t be read, they can be listed. Listing them will include the &lt;code&gt;&amp;lt;sha&amp;gt;&lt;/code&gt; which you can use for your comparison. S&lt;/span&gt;ee chapter 12.8 here: &lt;a href="https://infocenter.nordicsemi.com/pdf/nrf91_at_commands_v2.1.pdf"&gt;https://infocenter.nordicsemi.com/pdf/nrf91_at_commands_v2.1.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Unfortunately, the sha hash is only listed correctly in v1.3.2, so an upgrade will be necessary.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Raoul&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Verifying Public and Private Certificates</title><link>https://devzone.nordicsemi.com/thread/395655?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2022 21:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41356058-0f0c-42f6-9ca5-0bec28c3a245</guid><dc:creator>kkksss</dc:creator><description>&lt;p&gt;Actually correction to above, the modem_key_mgmt_cmp and modem_key_mgmt_read cannot read the keys&amp;nbsp;&lt;span&gt;MODEM_KEY_MGMT_CRED_TYPE_PUBLIC_CERT and&amp;nbsp;&lt;/span&gt;&lt;span&gt;MODEM_KEY_MGMT_CRED_TYPE_PRIVATE_CERT.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tested the following and it works successfully in comparing and reading&amp;nbsp;&lt;/span&gt;MODEM_KEY_MGMT_CRED_TYPE_CA_CHAIN.&lt;/p&gt;
&lt;p&gt;The AT command behind the scenes is&lt;/p&gt;
&lt;p&gt;AT%CMNG=2,?,?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>