OS Manuals

/usr/bin/swtpm_ioctl

Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface

From swtpm 0.10.2-r5 (enterprise-packages), captured 2026-11-08 by running swtpm_ioctl --help (exit 0). permalink

TPM emulator control tool version 0.10.2, Copyright (c) 2015 IBM Corp.

Usage: /usr/bin/swtpm_ioctl command <device path>

The following commands are supported:
--tpm-device <device> : use the given device; default is /dev/tpm0
--tcp [<host>]:[<prt>]: connect to TPM on given host and port;
                        default host is 127.0.0.1, default port is 6546
--unix <path>         : connect to TPM using UnixIO socket
-c                    : get ptm capabilities
-i                    : do a hardware TPM_Init; if volatile state is found,
                        it will resume the TPM with it and delete it
                        afterwards
--stop                : stop the TPM without exiting
-s                    : shutdown the TPM; stops and exists
-e                    : get the tpmEstablished bit
-r <loc>              : reset the tpmEstablished bit; use the given locality
-v                    : store the TPM's volatile data
-C                    : cancel an ongoing TPM command
-l <loc>              : set the locality to the given number; valid
                        localities are 0-4
-h <data>             : hash the given data; if data is '-' then data are
                        read from stdin
--save <type> <file>  : store the TPM state blob of given type in a file;
                        type may be one of volatile, permanent, or savestate
--load <type> <file>  : load the TPM state blob of given type from a file;
                        type may be one of volatile, permanent, or savestate
-g                    : get configuration flags indicating which keys are in
                        use
-b <buffersize>       : set the buffer size of the TPM and get its current
                        size; get minimum and maximum supported sizes
--info <flags>        : get TPM implementation specific information;
                        flags must be an integer value
--lock-storage <n>    : lock the storage after it was unlocked; retry
                        n times with 10ms delay in between
--version             : display version and exit
--help                : display help screen and exit
Options (21)
OptionDescriptionSource
--unix path: connect to TPM using UnixIO sockethelp + man
-cGet the capability flags indicating which commands are supported.help + man
-iSend a hardware initialization signal to the swtpm_cuse/swtpm.help + man
--stop: stop the TPM without exitinghelp + man
-sInitiate a graceful shut down.help + man
-e: get the tpmEstablished bithelp + man
-r locReset the tpmEstablished bit using the given locality.help + man
-vHave the TPM write the volatile state to a file.help + man
-C: cancel an ongoing TPM commandhelp + man
-l locSet the locality for the subsequent TPM commands.help + man
-h dataReset and extend PCR 17 with the hash of the given data.help + man
--save type: store the TPM state blob of given type in a file;help + man
--load type: load the TPM state blob of given type from a file;help + man
-gGet configuration flags that for example indicate which keys (file encryption or migration key) are in use by the TPM.help + man
-b buffersize: set the buffer size of the TPM and get its current size;help
--info flagsGet information about the TPM implementation and its configuration in JSON format.help + man
--lock-storage nLock the storage and retry a given number of times with 10ms delay in between.help + man
--version: display version and exithelp
--help: display help screen and exithelp
--tpm-device deviceUse the given device. (in the manual page but not in --help)man
--tcp server>:<portConnect to the given server and port; (in the manual page but not in --help)man
Examples (3) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.