Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / doc / invoke-tpmtool.texi
1 @node tpmtool Invocation
2 @subsection Invoking tpmtool
3 @pindex tpmtool
4 @ignore
5 #  -*- buffer-read-only: t -*- vi: set ro:
6 #
7 # DO NOT EDIT THIS FILE   (invoke-tpmtool.texi)
8 #
9 # It has been AutoGen-ed
10 # From the definitions    ../src/tpmtool-args.def
11 # and the template file   agtexi-cmd.tpl
12 @end ignore
13
14
15 Program that allows handling cryptographic data from the TPM chip.
16
17 This section was generated by @strong{AutoGen},
18 using the @code{agtexi-cmd} template and the option descriptions for the @code{tpmtool} program.
19 This software is released under the GNU General Public License, version 3 or later.
20
21
22 @anchor{tpmtool usage}
23 @subsection tpmtool help/usage (@option{--help})
24 @cindex tpmtool help
25
26 This is the automatically generated usage text for tpmtool.
27
28 The text printed is the same whether selected with the @code{help} option
29 (@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
30 the usage text by passing it through a pager program.
31 @code{more-help} is disabled on platforms without a working
32 @code{fork(2)} function.  The @code{PAGER} environment variable is
33 used to select the program, defaulting to @file{more}.  Both will exit
34 with a status code of 0.
35
36 @exampleindent 0
37 @example
38 tpmtool is unavailable - no --help
39 @end example
40 @exampleindent 4
41
42 @anchor{tpmtool debug}
43 @subsection debug option (-d)
44
45 This is the ``enable debugging'' option.
46 This option takes a number argument.
47 Specifies the debug level.
48 @anchor{tpmtool generate-rsa}
49 @subsection generate-rsa option
50
51 This is the ``generate an rsa private-public key pair'' option.
52 Generates an RSA private-public key pair in the TPM chip. 
53 The key may be stored in filesystem and protected by a PIN, or stored (registered)
54 in the TPM chip flash.
55 @anchor{tpmtool user}
56 @subsection user option
57
58 This is the ``any registered key will be a user key'' option.
59
60 @noindent
61 This option has some usage constraints.  It:
62 @itemize @bullet
63 @item
64 must appear in combination with the following options:
65 register.
66 @item
67 must not appear in combination with any of the following options:
68 system.
69 @end itemize
70
71 The generated key will be stored in a user specific persistent storage.
72 @anchor{tpmtool system}
73 @subsection system option
74
75 This is the ``any registred key will be a system key'' option.
76
77 @noindent
78 This option has some usage constraints.  It:
79 @itemize @bullet
80 @item
81 must appear in combination with the following options:
82 register.
83 @item
84 must not appear in combination with any of the following options:
85 user.
86 @end itemize
87
88 The generated key will be stored in system persistent storage.
89 @anchor{tpmtool test-sign}
90 @subsection test-sign option
91
92 This is the ``tests the signature operation of the provided object'' option.
93 This option takes a string argument @file{url}.
94 It can be used to test the correct operation of the signature operation.
95 This operation will sign and verify the signed data.
96 @anchor{tpmtool sec-param}
97 @subsection sec-param option
98
99 This is the ``specify the security level [low, legacy, medium, high, ultra].'' option.
100 This option takes a string argument @file{Security parameter}.
101 This is alternative to the bits option. Note however that the
102 values allowed by the TPM chip are quantized and given values may be rounded up.
103 @anchor{tpmtool inder}
104 @subsection inder option
105
106 This is the ``use the der format for keys.'' option.
107
108 @noindent
109 This option has some usage constraints.  It:
110 @itemize @bullet
111 @item
112 can be disabled with --no-inder.
113 @end itemize
114
115 The input files will be assumed to be in the portable
116 DER format of TPM. The default format is a custom format used by various
117 TPM tools
118 @anchor{tpmtool outder}
119 @subsection outder option
120
121 This is the ``use der format for output keys'' option.
122
123 @noindent
124 This option has some usage constraints.  It:
125 @itemize @bullet
126 @item
127 can be disabled with --no-outder.
128 @end itemize
129
130 The output will be in the TPM portable DER format.
131 @anchor{tpmtool exit status}
132 @subsection tpmtool exit status
133
134 One of the following exit values will be returned:
135 @table @samp
136 @item 0 (EXIT_SUCCESS)
137 Successful program execution.
138 @item 1 (EXIT_FAILURE)
139 The operation failed or the command syntax was not valid.
140 @end table
141 @anchor{tpmtool See Also}
142 @subsection tpmtool See Also
143     p11tool (1), certtool (1)
144 @anchor{tpmtool Examples}
145 @subsection tpmtool Examples
146 To generate a key that is to be stored in filesystem use:
147 @example
148 $ tpmtool --generate-rsa --bits 2048 --outfile tpmkey.pem
149 @end example
150
151 To generate a key that is to be stored in TPM's flash use:
152 @example
153 $ tpmtool --generate-rsa --bits 2048 --register --user
154 @end example
155
156 To get the public key of a TPM key use:
157 @example
158 $ tpmtool --pubkey tpmkey:uuid=58ad734b-bde6-45c7-89d8-756a55ad1891;storage=user \
159           --outfile pubkey.pem
160 @end example
161
162 or if the key is stored in the filesystem:
163 @example
164 $ tpmtool --pubkey tpmkey:file=tmpkey.pem --outfile pubkey.pem
165 @end example
166
167 To list all keys stored in TPM use:
168 @example
169 $ tpmtool --list
170 @end example