tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
150 stars 100 forks source link

RSA key not available for TLS communication from client #280

Open kishansinghtks opened 9 months ago

kishansinghtks commented 9 months ago

I am using tpm2tss for secure communication

command: ./tpm2tss-genkey -a rsa -s 2048 -P 0x81000000 mykey

and then extract the public key using the following command. openssl rsa -engine tpm2tss -inform engine -in mykey -pubout -outform pem -out mykey.pub

For client connections I use the command: openssl s_client -engine tpm2tss -connect example.com:9200 -CAfile ~/myCA.pem -cert client-crt.signedby.myca.pem -keyform engine -key mykey

Is there any way I can decrypt the mykey to a RSA key or use the public key for client connections as my app needs it to be in RSA format and the check for it, the code where it is failing is as below image