-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import existing keys into TPM for use with openssl #39
Comments
This is a duplicate of #12 though title and description are better. |
And yes... in the meantime, assuming that primary key you generated is the same as the one the engine would generate, you can actually take those binary blobs and put them into a PEM file. How are you at writing ASN.1 structures by hand...? :) Run |
Thanks for this information! I am off for one week now and will try this when I am back. |
Note for implementer: This is about importing keys generated openssl. |
For the public and private portions of the object returned by tpm2_import or a create command, we just serialize the blob and write to disk. So they would be in the proper format to un- serialize and hand off to ESYS. Perhaps a tool in this project to convert those blobs into the ossl engine format or use them directly and have a different way to provide needed metadata? |
Whichever on-disk format(s) end up being supported, please ensure they are in one of two categories:
Think carefully about whether you should ever do something in the latter category. |
The tpm2tss-genkey executable shall (in the future) gain 2 import parameters to support importing of OpenSSL-PEM-keys as well as TPM2-keyblobs. Maybe even auto-detectable. So implementer note: The tpm2_import command from tpm2-tools has some code snippets for reuse here. |
Try this utility: I used it also to connect OpenVPN to AWS Client VPN |
There's also some prototype bit-rotting at https://github.com/AndreasFuchsSIT/tpm2-tss-engine/tree/add_tpmkey_import |
Any chance of picking this up? I'm (finally) adding some TPM testing to OpenConnect and would like to be able to import the existing keys from the test suite. |
Is anyone working on this? |
Hi
My usecase is to import existing keys into the TPM to be able to use it for an TLS connection using openssl.
What works so far is to generate a key inside tpm on client and server, generate the certificates and connect:
-> execute on client or server accordingly...
"export TYPE=client|server"
generate key in tpm
gen a cert sign request
gen the certificate
on server:
on client:
But what I really want is to use existing private key and certificate on the client. So I tried to import my key into the TPM.
generate primary
But now I have the encrypted parts of the private and public keys in a binary format. I need it in tss format for openssl to be usefull.
Can this be converted?
Where to go from here? Or am I on the wrong path with this approach?
The text was updated successfully, but these errors were encountered: