]> git.proxmox.com Git - swtpm.git/blame - man/man8/swtpm.pod
tpm_fastpath
[swtpm.git] / man / man8 / swtpm.pod
CommitLineData
f163b202
SB
1=head1 NAME
2
3swtpm
4
5=head1 SYNOPSIS
6
7B<swtpm socket [OPTIONS]>
8
29cfd0a4
SB
9B<swtpm chardev [OPTIONS]>
10
78c5f924
SB
11B<swtpm cuse [OPTIONS]>
12
f163b202
SB
13=head1 DESCRIPTION
14
15B<swtpm> implements a TPM software emulator built on libtpms.
29cfd0a4 16It provides access to TPM functionality over a TCP/IP socket interface
78c5f924
SB
17or it can listend for commands on a character device, or create a CUSE
18(character device in userspace) interface for receiving of TPM commands.
f163b202
SB
19
20Unless corresponding command line parameters are used, the
29cfd0a4 21B<swtpm> socket version requires that the environment variable I<TPM_PORT>
f163b202
SB
22be set to the TCP/IP port the process is supposed to listen on for TPM
23request messages.
24
bc525ccd 25Similarly, the environment variable I<TPM_PATH> can be set and
f163b202 26contain the name of a directory where the TPM can store its persistent
bc525ccd 27state into.
f163b202 28
29cfd0a4 29The B<swtpm> process can be gracefully terminated by sending a
f163b202
SB
30I<SIGTERM> signal to it.
31
78c5f924
SB
32The B<swtpm> cuse version requires root rights to start the TPM.
33
29cfd0a4
SB
34=head1 Options for socket interface
35
f163b202
SB
36The following options are supported if the I<socket> interface is chosen:
37
38=over 4
39
40=item B<-p|--port <port>>
41
42Use the given port rather than using the environment variable TPM_PORT.
43
29cfd0a4
SB
44=item B<-t|--terminate>
45
46Terminate the TPM after the client has closed the connection.
47
48=back
49
50
51=head1 Options for character device interface
52
78c5f924 53The following options are supported if the I<chardev> interface is chosen:
29cfd0a4
SB
54
55=over 4
56
57=item B<-c|--chardev <device path>>
58
59Use the given device to listen for TPM commands and send response on.
60
78c5f924
SB
61=item B<--ctrl type=[unixio|tcp][,path=E<lt>pathE<gt>][,port=E<lt>portE<gt>][,fd=E<lt>filedescriptorE<gt>] >
62
63This option adds a control channel to the TPM. The control channel can either use a UnixIO socket with
64a given I<path> or I<filedescriptor> or it can use a TCP socket on the given I<port> or I<filedescriptor>.
65
66The control channel enables out-of-band control of the TPM, such as resetting the TPM.
67
29cfd0a4
SB
68=back
69
70
78c5f924 71=head1 Options for the CUSE interface
29cfd0a4 72
78c5f924 73The following options are supported if the I<cuse> interface is chosen:
29cfd0a4
SB
74
75=over 4
76
78c5f924 77=item B<-n|--name <NAME>>
f163b202 78
78c5f924
SB
79The TPM will use a device with the given name. A device with the given name
80will be created in /dev. This is a mandatory option.
81
82=item B<-M|--maj <MAJOR>>
83
84Create the device with the given major number.
85
86=item B<-m|--min <MINOR>>
87
88Create the device with the given minor number.
89
90=item B<--migration-key file=E<lt>keyfileE<gt>[,format=E<lt>hex|binaryE<gt>][,mode=aes-cbc],[remove[=true|false]]>
91
92The availability of a migration key ensures that the state of the TPM
93will not be revealed in unencrypted form when
94the TPM state blobs are retreived through the ioctl interface.
95The migration key is not used for encrypting TPM state written to files,
96this is what the I<--key> parameter is used for.
97
98The migration key and the key used for encrypting the TPM state files may be the same.
99
100While the key for the TPM state files needs to stay with those files it encrypts, the
101migration key needs to stay with the TPM state blobs. If for example the state of the
102TPM is migrated between hosts in a data center, then the TPM migration key must be
103available at all the destinations, so in effect it may have to be a key shared across
104all machines in the datacenter. In contrast to that, the key used for encrypting the
105TPM state B<files> can be different for each TPM and need only be available
106on the host where the TPM state resides.
107
108The migration key enables the encryption of the TPM state blobs of the TPM.
109The keyfile must contain an AES key of supported size; currently only 128 bit (16 bytes)
110keys are supported.
111
112The key may be in binary format, in which case the file size must be 16 bytes.
113If the key is in hex format (default), the key may consist of 32 hex digits
114starting with an optional '0x'.
115
116The I<mode> parameter indicates which block chaining mode is to be used.
117Currently only aes-cbc is supported.
118
119The I<remove> parameter will attempt to remove the given keyfile once the key
120has been read.
121
122=item B<--migration-key pwdfile=E<lt>passphrase fileE<gt>[,mode=aes-cbc],[remove[=true|false]]>
123
124This variant of the migration key parameter allows to provide a passphrase in a file.
125A maximum of 32 bytes are read from the file and a key is derived from it using a
126SHA512 hash. Currently only 128 bit keys are supported.
127
128=back
129
130
131=head1 Options for socket and character device interfaces:
132
133The following options are supported by the socket and character device interfaces:
134
135=over 4
f163b202
SB
136
137=item B<-f|--fd <fd>>
138
29cfd0a4
SB
139Use the given socket file descriptor or character device file descriptor
140for receiving TPM commands and sending responses.
141For the socket interface, this option automatically assumes -t.
f163b202 142
78c5f924
SB
143=item B<-d|--daemon>
144
145Daemonize the process.
146
147=back
148
149
150=head1 Options for all interfaces
151
152The following options are support by all interfaces:
153
154=over 4
155
156=item B<--tpmstate dir=E<lt>dirE<gt>>
157
158Use the given path rather than using the environment variable TPM_PATH.
159
f163b202
SB
160=item B<--log fd=E<lt>fdE<gt>|file=E<lt>pathE<gt>>
161
162Enable logging to a file given its file descriptor or its path. Use '-' for path to
163suppress the logging.
164
165=item B<--key file=E<lt>keyfileE<gt>[,format=E<lt>hex|binaryE<gt>][,mode=aes-cbc],[remove[=true|false]]>
166
167Enable encryption of the state files of the TPM. The keyfile must contain
168an AES key of supported size; currently only 128 bit (16 bytes) keys are
169supported.
170
171The key may be in binary format, in which case the file size must be 16 bytes.
172If the key is in hex format (default), the key may consist of 32 hex digits
173starting with an optional '0x'.
174
175The I<mode> parameter indicates which block chaining mode is to be used.
176Currently only aes-cbc is supported.
177
178The I<remove> parameter will attempt to remove the given keyfile once the key
179has been read.
180
181=item B<--key pwdfile=E<lt>passphrase fileE<gt>[,mode=aes-cbc],[remove[=true|false]]>
182
183This variant of the key parameter allows to provide a passphrase in a file.
184A maximum of 32 bytes are read from the file and a key is derived from it using a
185SHA512 hash. Currently only 128 bit keys are supported.
186
b2151737
SB
187=item B<--pid file=E<lt>pidfileE<gt>>
188
189This options allows to set the name of file where the process ID (pid) of the TPM
190will be written into.
191
bb420d74
SB
192=item B<-r|--runas E<lt>ownerE<gt>>
193
194Switch to the given user. This option can only be used when swtpm is started as root.
195
f163b202
SB
196=item B<-h|--help>
197
198Display usage info.
199
200=back
201
202
203=head1 SEE ALSO
204
78c5f924 205B<swtpm_bios>, B<swtpm_cuse>