You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use a primary key's ctx file (created with tpm2-tools) to sign some data using the "github.com/google/go-tpm/tpm2" package. Im using tpm2 and am on an ubuntu linux VM.
I'm using these commands to create the key in the terminal. Im creating the key as a transient object, rather than saving it to a persistent handle.
tpmDevice:="/dev/tpmrm0"tpm, err:=transport.OpenTPM(tpmDevice)
iferr!=nil {
fmt.Printf("Could not connect to TPM: %v", err)
}
Im currently having an issue trying to load the key handle of the idevid.ctx file into the KeyHandle field in the Sign struct. The examples I have seen in the go-tpm repo seem to make the keys using go-tpm with functions like CreatePrimary and then pass the key handle returned by CreatePrimary into other functions like Sign. In my case I need to get the key handle object by loading an external idevid.ctx file. Below an example of code that im building off of to sign data.
I wrote the following code to decode the ctx file and load its contents into a TPMSContext object. Using the tpm2-tools tpm2_print command, Ive been able to confirm that the value of the savehandle, hierarchy, sequence and contextblob size are correct and that they are the correct type. I have not been able to verify if the value of contextblob is correct.
I have tried directly loading the ctx.SavedHandle variable (which is type TPMHandle) and I tried using the KnownName function on it to get the name and then pass the handle and name value into the NamedHandle object.
Is it possible to use a primary key's ctx file (created with tpm2-tools) to sign some data using the "github.com/google/go-tpm/tpm2" package. Im using tpm2 and am on an ubuntu linux VM.
I'm using these commands to create the key in the terminal. Im creating the key as a transient object, rather than saving it to a persistent handle.
I am able to sign data with idevid.ctx key created above with the following tpm2 tools commands
Im making a connection to the TPM using the "github.com/google/go-tpm/tpm2/transport" package
Im currently having an issue trying to load the key handle of the idevid.ctx file into the KeyHandle field in the Sign struct. The examples I have seen in the go-tpm repo seem to make the keys using go-tpm with functions like CreatePrimary and then pass the key handle returned by CreatePrimary into other functions like Sign. In my case I need to get the key handle object by loading an external idevid.ctx file. Below an example of code that im building off of to sign data.
I wrote the following code to decode the ctx file and load its contents into a TPMSContext object. Using the tpm2-tools tpm2_print command, Ive been able to confirm that the value of the savehandle, hierarchy, sequence and contextblob size are correct and that they are the correct type. I have not been able to verify if the value of contextblob is correct.
I have tried directly loading the ctx.SavedHandle variable (which is type TPMHandle) and I tried using the KnownName function on it to get the name and then pass the handle and name value into the NamedHandle object.
It seems that the value returned by ctx.SaveHandle.KnownName() is nil. So when I run the code above I get the following error
I have also tried to use the ContextLoad function to get the key handle from the idevid.ctx file to pass into the Sign struct
When I run the code above to load the context I get the following error.
Is there a way that I can load the idevid.ctx file and use go-tpm to sign data?
The text was updated successfully, but these errors were encountered: