tpm2_getpolicydigest(1)
π tpm2_getpolicydigest(1) β General Commands Manual π
okay so bestie, buckle up: this is the page for tpm2_getpolicydigest(1), and it's genuinely one of the simpler ones β it just retrieves the policy digest from a session. That's the whole vibe. Let's get into it π
β¨ NAME β¨
tpm2_getpolicydigest(1) β retrieves the policy digest from session. yep, that's it, that's the girl π
π¦ SYNOPSIS π¦
tpm2_getpolicydigest [OPTIONS] [ARGUMENT]
literally that's the whole shape of it. [OPTIONS] and one [ARGUMENT], both optional, no drama πΈ
π DESCRIPTION π
tpm2_getpolicydigest(1) returns the policydigest of a session. that's the entire personality π₯
By default the output goes to stdout and it comes out in binary format β unless you say otherwise with the -o option and the --hex option respectively. so like, you can change both the destination and the format, but only if you actually ask. otherwise: binary, stdout, no cap π
π OPTIONS π
-o,--output=FILEβ tells it which filename to write the raw bytes to. defaults to stdout as a hex string π«Ά--hexβ converts the output data to hex format, and ngl it does it without a leading"0x". so no cute little prefix, just the hex, periodt β¨-S,--session=FILE:β the session, created usingtpm2_startauthsession. this is your main character option, it's the whole point of the command π
tiny note from the original page: there's a stray References bit just hanging out between the options and the common options. we don't know her, we don't question her, we simply report that she is there π
π COMMON OPTIONS π
okay so this collection of options is common to a bunch of these programs, and they provide information that many users may expect. group-chat classics, basically π
-h,--help=[man|no-man]β displays the tool's manpage. by default it tries to invoke the manpager for the tool, BUT if that fails it'll just output a short tool summary. same behavior if you pass the"man"option argument β however (!!) if you explicitly request"man", the tool will hand you errors frommanon stderr instead. and if"no-man"is specified, or the manpager just flops, the short options get output to stdout. to successfully use the manpages feature, you need the manpages installed or onMANPATH. seeman(1)for more details, iykyk π-v,--versionβ displays version information for this tool, plus the supported tctis, then exits. cute little flex π-V,--verboseβ increases the information the tool prints to the console during execution. when you use this option, the file and line number get printed too. detective mode π-Q,--quietβ silences normal tool output to stdout. she's not talking to you rn π€«-Z,--enable-errataβ enables the application of errata fixups. useful if an errata fixup needs to be applied to commands sent to the TPM. defining the environment variableTPM2TOOLS_ENABLE_ERRATAis equivalent. same energy, different door πͺ-z,--pwd-sessionβ uses a password session instead of a HMAC session for authentication. a clear text password is passed to the TPM to authorize the action. this option can be used to avoid problems when unsalted sessions are used in OpenSSL FIPS mode. if auth values are used, a salted session should be used for authentication. noted, bestie, safety first π§-R,--autoflushβ enables autoflush for transient objects created by the command. if a parent object is loaded from a context file, then also the transient parent object will be flushed. autoflush can also be activated if the environment variableTPM2TOOLS_AUTOFLUSHis set toyesortrue. (and yes, the original page trails off with information many users may expect right after that β copy-paste queen behavior, we respect it π) π
π TCTI Configuration π
The TCTI, aka "Transmission Interface", is the communication mechanism with the TPM. TCTIs can be changed for communication with TPMs across different mediums. so like, it's the group chat the tool and the TPM are in together π±
To control the TCTI, the tools respect:
- The command line option
-Tor--tcti - The environment variable:
TPM2TOOLS_TCTI
Note: the command line option always overrides the environment variable. no exceptions, she said what she said π
The current known TCTIs are:
tabrmdβ the resource manager, calledtabrmd. note thattabrmdandabrmdas a tcti name are synonymous. same girl, two names π―mssimβ typically used for communicating to the TPM software simulator πΈdeviceβ used when talking directly to a TPM device file πnoneβ do not initalize a connection with the TPM. some tools allow for off-tpm options and thus support not using a TCTI. tools that do not support it will error when attempted to be used without a TCTI connection. does not support ANY options and MUST BE presented as the exact text of"none". (sic β "initalize" is the original's spelling, we keep her π)
The arguments to either the command line option or the environment variable are in the form:
<tcti-name>:<tcti-option-config>
Specifying an empty string for either the <tcti-name> or the <tcti-option-config> results in the default being used for that portion respectively. blank = default, easy π¦
π TCTI Defaults π
When a TCTI is not specified, the default TCTI is searched for using dlopen(3) semantics. the tools will search for tabrmd, device and mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. you can query what TCTI will be chosen as the default by using the -v option to print the version information β the "default-tcti" key-value pair will indicate which of the aforementioned TCTIs is the default. it's giving first-come-first-served π
π§ Custom TCTIs π§
Any TCTI that implements the dynamic TCTI interface can be loaded. the tools internally use dlopen(3), and the raw tcti-name value is used for the lookup. so this could be a path to the shared library, or a library name as understood by dlopen(3) semantics. bring your own, we love a guest star π
π₯ TCTI OPTIONS π₯
This collection of options is used to configure the various known TCTI modules available:
device: for the device TCTI, the TPM character device file for use by the device TCTI can be specified. the default is/dev/tpm0. Example:-T device:/dev/tpm0orexport TPM2TOOLS_TCTI="device:/dev/tpm0"mssim: for the mssim TCTI, the domain name or IP address and port number used by the simulator can be specified. the default are127.0.0.1and2321. Example:-T mssim:host=localhost,port=2321orexport TPM2TOOLS_TCTI="mssim:host=localhost,port=2321"abrmd: for the abrmd TCTI, the configuration string format is a series of simple key value pairs separated by a,character. each key and value string are separated by a=character.- TCTI abrmd supports two keys:
bus_name: the name of the tabrmd service on the bus (a string).bus_type: the type of the dbus instance (a string) limited tosessionandsystem.
- TCTI abrmd supports two keys:
Specify the tabrmd tcti name and a config string of bus_name=com.example.FooBar:
\--tcti=tabrmd:bus_name=com.example.FooBar
Specify the default (abrmd) tcti and a config string of bus_type=session:
\--tcti:bus_type=session
NOTE:abrmdandtabrmdare synonymous. (the original page ends this section with the fragment the various known TCTI modules. β another little copy-paste ghost, keeping her here for accuracy π»)
πΈ EXAMPLES πΈ
π« Create a session and retrieve policydigest π«
tpm2 startauthsession -S session.ctx
tpm2 policypassword -S session.ctx -L test.policy
tpm2 getpolicydigest -S session.ctx -o policy.out
tpm2 flushcontext session.ctx
like, look at her go. start a session, set a policy, grab the digest, flush the context. clean, iconic, no notes π β¨
β Returns β
Tools can return any of the following codes:
0β Success. we love a win π1β General non-specific error. vague, mysterious, honestly relatable π2β Options handling error. you did too much with the flags, bestie π3β Authentication error. she doesn't know you like that π4β TCTI related error. communication breakdown π5β Non supported scheme. applicable totpm2_testparams.
π BUGS π
Github Issues β that's where you go π«Ά
π HELP π
See the Mailing List π
Β©οΈ License Β©οΈ
This work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). slay, legally π
okay that's the whole page, bestie β and fr fr, this one ships as part of tpm2-tools, so go forth and get those policy digests. no date on this footer, just the source, we keep it 100 πππ¦
π¦ where this page comes from
- arch rolling: tpm2-tools 5.8-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms