Hello dgarske,
thanks for your answer, it gave me back some hope...
So, you say I can store a primary key in such a way only my TPM is able to re-load it.
This is exactly what I need !
It's even better than store it in NV, because it is safe from any kind of reset of the TPM...
(even if I don't know if a TPM may be reset)
But then the question is how to store a fresh primary key:
When I pause the execution just after primary key creation
(here https://github.com/wolfSSL/wolfTPM/blob … rap.c#L829)
I get a huge structure CreatePrimary_Out which looks like that (sorry, it's big!) :
createPriOut
objectHandle 0x80ffffff
outPublic
size 0x011a
publicArea
type 0x0001
nameAlg 0x000b
objectAttributes 0x00030472
authPolicy {size=0x0000 buffer="" }
parameters
rsaDetail
symmetric
algorithm 0x0006
keyBits {aes=0x0080 sym=0x0080 xorr=0x0080 }
mode {aes=0x0043 sym=0x0043 }
scheme
scheme 0x0010
details {rsassa={hashAlg=0xcccc } rsapss={hashAlg=0xcccc } ...}
keyBits 0x0800
exponent 0x00000000
unique
rsa
size 0x0100
buffer "ÈŇ^Ì«\x11ÀÅst¼°6f‚Z‡uÁÐ…gÔºÄÐ5tH‘ïJŸ‚\tFÕ!ÖgK§..."
creationData
size 0x0037
creationData
pcrSelect
count 0x00000000
pcrSelections
[0]
hash 0xcccc
sizeofSelect 0xcc 'Ì'
pcrSelect
[0] 0xcc 'Ì'
[1] 0xcc 'Ì'
[2] 0xcc 'Ì'
[1]
hash 0xcccc
sizeofSelect 0xcc 'Ì'
pcrSelect
[0] 0xcc 'Ì'
[1] 0xcc 'Ì'
[2] 0xcc 'Ì'
pcrDigest {size=0x0020 buffer="ã°ÄB˜ü\x1c\x14šûôÈ™o¹$'®Aäd›“L¤•™\x1bxR¸U" }
locality 0x01 '\x1'
parentNameAlg 0x0010
parentName {size=0x0004 name="@" }
parentQualifiedName {size=0x0004 name="@" }
outsideInfo {size=0x0000 buffer="..." }
creationHash {size=0x0020 buffer="] AºÀî15®»\fû¤—Æ¡‡®ƒ-ÓÑø÷¨q¸%èT" }
creationTicket
tag 0x8021
hierarchy 0x40000001
digest {size=0x0020 buffer="£Ú\nOšBÛÞ\x1d¡\x1a“÷jáÝA«ˆñÈ\x1?:Êÿ¤\x10f5X" }
name {size=0x0022 name="" }
What should I store among the whole stuff ?
(I didn't find any API function to export/serialize a primary key into a blob)
Let's assume that I know how to do it, then, how do I re-load it into a primary key ?
Thanks in advance !
Hadrien
PS : by the way, WindowsTBS.md seems almost empty...