Skip to contentSkip to conversation

Need Help to parse AK public key

tpm2 chenxiz at fb.com 3 participants 5 messages Feb 19, 2020

lore
Share & tools
lore

chenxiz at fb.com

#0 lore raw

Hi,

I created a 2048 RSA AK by using the command below :
tpm2_createak -C 0x81010001 -c ak.ctx -u ak.pub -r ak.priv -n ak.name -P dummypwd -p dummypwd

ak.pub file size = 282 bytes.
$stat --printf="%s" ak.pub
282

I would like to parse the RSA public key, i.e., e and n, Can anyone help me elaborate the ak.pub format or is there any tool I can use to parse it?

TPM2 tools version (all are the latest):
tpm2-tools-4.1.1
tpm2-abrmd-2.3.1
tpm2-tss-2.3.2

Thanks,
Chenxi

#1 lore raw

Hello,

you can specify a format via the -f switch.

Use -f pem

tpm2_createak -C 0x81010001 -c ak.ctx -u ak.pub -r ak.priv -n ak.name -P dummypwd -p dummypwd -f pem

regards,
Steffen Schwebel

Quoted 23 lines · chenxiz(a)fb.com

Hi,

I created a 2048 RSA AK by using the command below :
tpm2_createak -C 0x81010001 -c ak.ctx -u ak.pub -r ak.priv -n ak.name -P dummypwd -p dummypwd

ak.pub file size = 282 bytes.
$stat --printf="%s" ak.pub
282

I would like to parse the RSA public key, i.e., e and n, Can anyone help me elaborate the ak.pub format or is there any tool I can use to parse it?

TPM2 tools version (all are the latest):
tpm2-tools-4.1.1
tpm2-abrmd-2.3.1
tpm2-tss-2.3.2

Thanks,
Chenxi
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#2 lore raw

Thanks Steffen, It helps!

thanks,
Chenxi

#3 lore raw

You can also use tpm2_readpublic for an already created one!

tpm2_readpublic -c ak.ctx -f PEM -o ak.pem

tpm2_readpublic -c 0x81010001 -f PEM -o ak.pem

#4 lore raw

thanks. It is even better.