I'm responding to https://lists.01.org/pipermail/tpm2/2019-June/001204.html
which I found referenced at
In "A Practical Guide to TPM 2.0", the instructions claim "At this point,
the local platform has received an HMAC key from the IT central system *that
has never been decrypted in the local system’s memory.*" [emphasis added]
You would reverse the steps:
1. The receiving application would check that IT signature matches
that the cert chain is valid. Use normal OSSL.
2. decrypt the blob (key) with RSA Decrypt using the TPM private key
corresponding with the public portion used for encrypt
3. Now that you have the plaintext blob (actual symmetric key), call
If you're using the TPM to simply decrypt and get the plaintext blob /
actual symmetric key, then haven't you exposed it to the local system's
I think to avoid that, you need to use tpm2_duplicate to generate the
duplicated key using the target parent storage key , and then use
tpm2_import to directly import the duplicated key under the storage key .
What I'm a little unclear about is whether, before calling tpm2_duplicate,
there's a way to ensure that the storage key *can't* be used to simply
decrypt and expose the key to system memory. I imagine this requires
attestation about the storage key's attributes.