<?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 — Compatibility between tpm2 and wolftpm!! What Format is wolfTpm using?]]></title>
		<link>https://www.wolfssl.com/forums/topic1894-compatibility-between-tpm2-and-wolftpm-what-format-is-wolftpm-using.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1894.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Compatibility between tpm2 and wolftpm!! What Format is wolfTpm using?.]]></description>
		<lastBuildDate>Fri, 15 Jul 2022 17:45:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Compatibility between tpm2 and wolftpm!! What Format is wolfTpm using?]]></title>
			<link>https://www.wolfssl.com/forums/post6652.html#p6652</link>
			<description><![CDATA[<p>Hi tpm2user,</p><p>I am not familiar with `openssl.ctx` or ` --key-context`, however I can show you have to load an external private key to the null hierarchy.</p><p>1) make sure you are using DER format (binary ASN.1, not PEM). Use `-outform der`.<br />2) Use `wc_RsaPrivateKeyDecode`<br />3) `wolfTPM2_RsaKey_WolfToTpm_ex` to load into a WOLFTPM2_KEY. </p><p>We have an example here:<br /><a href="https://github.com/wolfSSL/wolfTPM/blob/master/examples/wrap/wrap_test.c#L431">https://github.com/wolfSSL/wolfTPM/blob … est.c#L431</a></p><p>However I don&#039;t have one loading a PEM or DER to the null hierarchy. I&#039;ll see about adding an example for this.</p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Fri, 15 Jul 2022 17:45:30 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6652.html#p6652</guid>
		</item>
		<item>
			<title><![CDATA[Compatibility between tpm2 and wolftpm!! What Format is wolfTpm using?]]></title>
			<link>https://www.wolfssl.com/forums/post6650.html#p6650</link>
			<description><![CDATA[<p>Hello,</p><p>I have generated a context file (openssl.ctx) with tpm (but via tpm2_tools). I wanted to know IF and HOW exactly can this be used/imported via wolftpm?</p><p>1. Use OpenSSL to create the device&#039;s public-private key pair, forgoing TPM protections. i.e., the key material is not protected by the parent object&#039;s seed. </p><div class="codebox"><pre><code>openssl req -new -newkey rsa:2048 -keyout $HOME/openssl_private.pem -nodes \
            -out &quot;$HOME/openssl.csr&quot; \
            -subj &quot;/C=BE/ST=Belgium/L=Brussels/O=CPP-LS/OU=Development/CN=www.tpm.dev&quot;
 
openssl rsa -in &quot;$HOME/openssl_private.pem&quot; -out &quot;$HOME/openssl_public.pem&quot; -pubout</code></pre></div><p>2. Load the non-protected key pair to the TPM. The private portion of an object can be loaded only to the Null hierarchy or the TPM will reject loading it. </p><div class="codebox"><pre><code>tpm2_clear
 
tpm2_loadexternal --hierarchy n \
                  --key-algorithm rsa \
                  --public &quot;$HOME/openssl_public.pem&quot; \
                  --private &quot;$HOME/openssl_private.pem&quot; \
                  --key-context &quot;$HOME/openssl.ctx&quot; \
                  --name &quot;$HOME/openssl.name&quot;</code></pre></div><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<br />How can this file (openssl.ctx) be imported into wolftpm? I tried to convert it into base64 and import does not work. And directly importing it always results in Buffer Overflow from wolftpm side.</p><p>Many thanks!</p>]]></description>
			<author><![CDATA[null@example.com (tpm2user)]]></author>
			<pubDate>Fri, 15 Jul 2022 12:00:23 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6650.html#p6650</guid>
		</item>
	</channel>
</rss>
