[tpm2] import key in tss format into tpm2-pytss

Gadacz, Henry <henry.gadacz at sit.fraunhofer.de> Tue, 20 Sep 2022 13:20:02 +0000
Newsgroups dev.linux.lists.tpm2
Message-ID <FR0P281MB170650BDEAB61B6128173A5BD14C9@FR0P281MB1706.DEUP281.PROD.OUTLOOK.COM>
Hello everyone,

 

I have exported a public key with the tpm2-tools using tpm2_readpublic in
the default tss format (I guess it is a TPM2B_PUBLIC structure).

 

How can I load it into an TPM2B_PUBLIC or TPMT_PUBLIC object in tpm2-pytss,
so I can load it with the ESAPI.load_external() function? I have seen the
.from_pem() method, but I don't want to use pem format, because it does not
include the key attributes and other information.

 

Best Regards,

Henry
attachment.htm (text/html, 2.1 KB)
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=DE>Hello everyone,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p>&nbsp;</o:p></span></p><p class=MsoNormal>I have exported a public key with the tpm2-tools using tpm2_readpublic in the default tss format (I guess it is a TPM2B_PUBLIC structure).<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>How can I load it into an TPM2B_PUBLIC or TPMT_PUBLIC object in tpm2-pytss, so I can load it with the ESAPI.load_external() function? I have seen the .from_pem() method, but I don&#8217;t want to use pem format, because it does not include the key attributes and other information.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span lang=DE>Best Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE>Henry<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>
smime.p7s (application/pkcs7-signature, 7.7 KB) - not displayed