<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Load ECC public key from DER/PEM file]]></title>
		<link>https://www.wolfssl.com/forums/topic619-load-ecc-public-key-from-derpem-file.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic619.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Load ECC public key from DER/PEM file.]]></description>
		<lastBuildDate>Tue, 12 Jul 2016 20:52:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post2591.html#p2591</link>
			<description><![CDATA[<p>Hi sfefanoss1019,</p><p>If you want to import an ECC key in DER format into an ecc_key structure, you will want to use the following function.&nbsp; If you are importing an ECC generated by OpenSSL, you will want to compile wolfSSL with <strong>ECC_DECODE_EXTRA</strong> defined.</p><div class="codebox"><pre><code>#include &lt;wolfssl/wolfcrypt/asn_public.h&gt;
int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key, word32 inSz);</code></pre></div><p>If you instead want to import an ECC key into a WOLFSSL_CTX structure, for use in an SSL/TLS connection, you can use the following function.&nbsp; Again, you will need to compile wolfSSL with <strong>ECC_DECODE_EXTRA</strong> if loading an ECC key generated by OpenSSL:</p><div class="codebox"><pre><code>#include &lt;wolfssl/ssl.h&gt;
int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX* ctx, const char* file, int format);</code></pre></div><p>The &quot;format&quot; parameter in the above function should be either <strong>SSL_FILETYPE_PEM</strong> if the key is PEM formatted or <strong>SSL_FILETYPE_ASN1</strong> for a DER formatted key.</p><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 12 Jul 2016 20:52:05 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2591.html#p2591</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post2585.html#p2585</link>
			<description><![CDATA[<p>@mamonetti Did you find a solution for this? About how to import the key.</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (stefanoss1019)]]></author>
			<pubDate>Fri, 08 Jul 2016 14:51:31 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2585.html#p2585</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post1906.html#p1906</link>
			<description><![CDATA[<p>In order to create the private key:<br />openssl ecparam -name secp160r1 -genkey -noout -out secp160r1-key.pem</p><p>With this one you get the public key based on the previous private key:<br />openssl ec -in secp160r1-key.pem -pubout -out secp160r1-pub-key.pem</p><p>And this is the same as the previous one, but to create the public key in der format:<br />openssl ec -in secp160r1-key.pem -pubout -outform DER -out secp160r1-pub-key.der</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (mamonetti)]]></author>
			<pubDate>Fri, 30 Jan 2015 19:17:15 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1906.html#p1906</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post1905.html#p1905</link>
			<description><![CDATA[<p>How did you create the public key?&nbsp; My versions of openssl ec don&#039;t have a -pubout option like the man page does online.</p><p>We&#039;ll add a feature request to input OpenSSL DER/PEM format for ECC public keys.</p><p>Thanks,<br />-Todd</p>]]></description>
			<author><![CDATA[null@example.com (todd)]]></author>
			<pubDate>Thu, 29 Jan 2015 23:26:45 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1905.html#p1905</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post1898.html#p1898</link>
			<description><![CDATA[<p>I&#039;m trying to load the public key from a file generated by openssl. In this case the idea is to load the key using the website embedded in my uC-powered board and store it in a non-volatile memory. So, even though I could deal with certificates, in my case loading it directly would be much easier.</p><p>However, as I said, having a way to convert from DER/PEM to X9.63 would be enough for me.</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (mamonetti)]]></author>
			<pubDate>Wed, 28 Jan 2015 13:02:05 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1898.html#p1898</guid>
		</item>
		<item>
			<title><![CDATA[Re: Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post1895.html#p1895</link>
			<description><![CDATA[<p>Typically a Public Key is retrieved from a Certificate.&nbsp; How are you getting the public key?&nbsp; If you have control you can specify the format.&nbsp; Is this for a specific protocol?</p><p>Thanks,<br />-Todd</p>]]></description>
			<author><![CDATA[null@example.com (todd)]]></author>
			<pubDate>Tue, 27 Jan 2015 23:05:58 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1895.html#p1895</guid>
		</item>
		<item>
			<title><![CDATA[Load ECC public key from DER/PEM file]]></title>
			<link>https://www.wolfssl.com/forums/post1889.html#p1889</link>
			<description><![CDATA[<p>Although you can load a private ECC key from a DER/PEM file, there is no such option for public keys. You can import it by having it in ANSI X9.63 format, but I don&#039;t know how to convert an openssl-generated key to this specific format.</p><p>So, I&#039;d like to know what to do, that is:<br />- how to convert from DER/PEM to X9.63, or<br />- how to load directly from DER/PEM.</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (mamonetti)]]></author>
			<pubDate>Fri, 23 Jan 2015 19:12:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post1889.html#p1889</guid>
		</item>
	</channel>
</rss>
