Recently I started working with a TPM (version 1.2), and after checking the oficial GnuTLS API, I was wondering which API functions are the correct ones to do all the crypto stuff inside the chip (sign certificates get pk+ keys etc...).
At the moment Im able of getting this data outside of the TPM so I can sign or get a private key in my C code but thats not what I want.
Thank all!
The sequence of events is something like this:
gnutls_tpm_key_list_get_urlto get the list of the TPM keys.gnutls_privkey_import_tpm_url.gnutls_privkey_tobject you can use with the abstract API just like any other key. In your case, you probably want to usegnutls_privkey_sign_dataor one of the similar signing functions.Keep in mind that going with this approach limits you to TPM 1.2. From GnuTLS docs: