TPM 1.2 getpubek comparison with existing file in system
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You could launch the tpm_getpubek command from your C program, redirecting the output to a file. The easiest method should be the system library function, e.g.
Code:
system("tpm_getpubek > somefile");
A cleaner solution is using the trousers software package. The function that corresponds to tpm_getpubek is probably Tspi_TPM_GetPubEndorsementKey.
Disclaimer: I know close to nothing about TPMs and trousers.
I have another question here. In the below code how I can make szTpmPasswd as default instead of user input.
Suppose my password is "abcd1234", how I can make it deafult so that this file can execute automatically. I tried to explicity pass an string to the szTpmPasswd but unable to get my result.
Sorry, but after looking at your question, I don't understand what you want.
Right now, the default value of szTpmPasswd is TSS_WELL_KNOWN_SECRET. You say you want to set a default password so that the program executes automatically. What do you mean by "automatically"? Normally, a program must be launched by a human or another program to execute.
You also say that you are unable to get your result. What is your result, and what do you get instead of the result?
What do you mean by "compare"? Do you want to understand if they are equal? If so, one solution would be to use the system call to run the command, redirecting output to a file. Then compare that file to the existing file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.