Skip to content
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 does tpm2-tss-engine generate a CSR, specifically the detailed process? #289

Open
bronzeMe opened this issue Oct 9, 2024 · 0 comments

Comments

@bronzeMe
Copy link

bronzeMe commented Oct 9, 2024

  • Command 1: tpm2tss generates a csr by using the persistent handle
    openssl req -new -engine tpm2tss -keyform engine -out client.csr -key 0x81010003
  • Command 2: OpenSSL natively generates a CSR using openssl req -new -key client.key -out client.csr -subj "/CN=TPM AK
  • For command 2, OpenSSL first constructs an unsigned CSR structure (extracting the public key information from the private key and filling the public key as a field in the CSR), then uses the private key to sign the CSR, and finally outputs a signed CSR.
  • For command 1, I understand that we can only obtain the public key from the TPM handler. How does the tpm2-tss-engine source code construct an unsigned CSR with only the public key, given that the private key cannot be retrieved from the TPM? My understanding is that it first exports the public key from the TPM handler to construct a CSR to be signed, and then calls the TPM's signing function to sign this unsigned CSR. Our goal is to understand and learn how to manually construct a CSR structure to be signed using only the public key.

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant