[tpm2] Want to use c++ to get TPM Serial Number - how do it?
Andy Purcell <andy_purcell at keysight.com>
| Newsgroups | dev.linux.lists.tpm2 |
|---|---|
| Message-ID | < <SA1PR17MB5432DD01C2498B7B1F50486E9FE29@SA1PR17MB5432.namprd17.prod.outlook.com>> |
I have a need to use C++ to obtain the unique TPM information - like a Serial Number.
My system is running Windows 10/64. This is on an HP Desktop PC with TPM 2.0 chip.
I can use PowerShell
Get-TpmEndorsementKeyInfo -hashalgorithm sha256
To get this output:
...
ManufacturerCertificates : {[Subject]
TPMVersion=id:073E, TPMModel=SLB 9670 TPM2.0, TPMManufacturer=id:49465800
[Issuer]
CN=Infineon OPTIGA(TM) RSA Manufacturing CA 034, OU=OPTIGA(TM) TPM2.0, O=Infineon Technologies AG, C=DE
...
[Serial Number]
4880DE8E
[Thumbprint]
B8395DA6A1D661C8CCD35D47E3DA6E9532EFFEC4
But how can I get this same Serial Number information using C++?
ap
attachment.htm
(text/html, 2.6 KB)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>I have a need to use C++ to obtain the unique TPM information – like a Serial Number. </div>
<div>My system is running Windows 10/64. This is on an HP Desktop PC with TPM 2.0 chip. </div>
<div> </div>
<div>I can use PowerShell </div>
<div style="text-indent:36pt;">Get-TpmEndorsementKeyInfo -hashalgorithm sha256</div>
<div> </div>
<div>To get this output: </div>
<div> … </div>
<div style="text-indent:36pt;">ManufacturerCertificates : {[Subject]</div>
<div> TPMVersion=id:073E, TPMModel=SLB 9670 TPM2.0, TPMManufacturer=id:49465800</div>
<div> [Issuer]</div>
<div> CN=Infineon OPTIGA(TM) RSA Manufacturing CA 034, OU=OPTIGA(TM) TPM2.0, O=Infineon Technologies AG, C=DE</div>
<div style="text-indent:36pt;padding-left:36pt;">…</div>
<div> [Serial Number]</div>
<div> 4880DE8E</div>
<div> [Thumbprint]</div>
<div> B8395DA6A1D661C8CCD35D47E3DA6E9532EFFEC4</div>
<div> </div>
<div>But how can I get this same Serial Number information using C++?</div>
<div> </div>
<div>ap</div>
<div> </div>
</span></font>
</body>
</html>