-
Notifications
You must be signed in to change notification settings - Fork 290
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
How to use private keys persisted in the TPM with tpm2-openssl OpenSSL Provider #4413
Comments
@nuts-i77 in the first case, the command below generates a standard PEM key not a TSS2 PRIVATE KEY. You can check the content of the
So it works for you with the PEM file as you are using the standard procedure (not using the TPM). I'm also trying to use a TSS2 PRIVATE KEY for a client mTLS session, so please let me know if you found a solution. In my case I'm getting the following error for both handle and TSS2 file:
|
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Node.js Version
v18.19.1
NPM Version
v9.2.0
Operating System
Linux test1 6.8.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Mon May 20 15:51:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
https
Description
I am trying to use the OpenSSL Provider's tpm2-openssl and the TPM for client certificate authentication in a Node.js application.
I was able to use a private key in PEM (TSS2 PRIVATE KEY) key format.
However, when I try to use a private key persisted in the TPM from Node.js, I get the ERR_OSSL_UNSUPPORTED error.
Does anyone have any ideas on how to use a private key persisted in a TPM from Node.js?
tpm2-openssl
https://github.com/tpm2-software/tpm2-openssl
Client certificate authentication using a PEM (TSS2 PRIVATE KEY) format key was successful using the following procedure.
Generate a private key
openssl genpkey -provider tpm2 -algorithm RSA -out clkey
Generate a CSR and issue a certificate from a CA using client.csr and save it as clcert.
openssl req -new -key clkey -provider tpm2 -provider base -out client.csr
Creating openssl.cnf
Creating a Node.js test program
Start test program
However, when I try to use a private key persisted in the TPM from Node.js, I get the ERR_OSSL_UNSUPPORTED error.
Persist the private key in the TPM handler
Generate a CSR and issue a certificate from a CA using client.csr and save it as clcert.
openssl req -new -key handle:0x81008100 -provider tpm2 -provider base -out client.csr
Creating openssl.cnf
Creating a Node.js test program
Start test program
Minimal Reproduction
No response
Output
No response
Before You Submit
The text was updated successfully, but these errors were encountered: