<?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>Command to check key type on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105257/command-to-check-key-type-on-ncs-v2-4-2</link><description>From https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/imgtool.html link, there are four key types. They are rsa-2048, rsa-3072, ecdsa-p256 and ed25519. Is there any command to check key type of *.pem file?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Nov 2023 10:35:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105257/command-to-check-key-type-on-ncs-v2-4-2" /><item><title>RE: Command to check key type on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/453473?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 10:35:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab3217d8-ed3e-49d2-b294-cabd7ad825b8</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Command to check key type on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/453469?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 10:30:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe3e0d76-9bea-49e5-b459-1ddfd5c2bb79</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I am not aware of any such tool.&lt;/p&gt;
&lt;p&gt;(If you have a binary image and not a key file you can use &lt;code&gt;python &amp;lt;path to imbtool&amp;gt;imgtool.py dumpinfo &amp;lt;path to binary&amp;gt;&lt;/code&gt;, but that will also not tell you the&amp;nbsp;exact curve being used.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Command to check key type on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/453467?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 10:21:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc47844-2aae-46eb-a069-34213b20d436</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! Do you mean no command tool to check key types?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Command to check key type on ncs v2.4.2</title><link>https://devzone.nordicsemi.com/thread/453465?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 10:19:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23289e43-2228-415d-84f0-ccbfc29f6687</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The PEM file must always start with &amp;quot;-----BEGIN&amp;quot; (from RFC 5280 and expanded in RFC 7468) and that line often continues with information about the key or certificate (see &lt;a href="https://github.com/openssl/openssl/blob/d030bac57c5e8b539836acc1320fc62a9a96f055/include/openssl/pem.h#L35"&gt;here&lt;/a&gt;), for instance as in this case:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIKiKxgi9DQnGfRBnE1mMQtvD+KNfiZh5PuSrMmm5O6d0oAoGCCqGSM49
AwEHoUQDQgAEWSrOulABBsRN31n2ApEB5NMg1ByuZrjDWu07jb/yfe2Frlt/GKF+
rcyECbU8zf2PBdQAFgN6D4reZ9BfWbEwiA==
-----END EC PRIVATE KEY-----&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here you see this is an elliptic cure key of some sort, but you&amp;nbsp;don&amp;#39;t see exactly which curve is used.&lt;/p&gt;
&lt;p&gt;For RSA, it can say &amp;quot;BEGIN RSA PRIVATE KEY&amp;quot; or just &amp;quot;BEGIN PRIVATE KEY&amp;quot;, but you will also notice that the key is much larger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>