openssl-ts.1ossl 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "OPENSSL-TS 1ossl"
  136. .TH OPENSSL-TS 1ossl "2025-06-29" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. openssl\-ts \- Time Stamping Authority command
  143. .SH "SYNOPSIS"
  144. .IX Header "SYNOPSIS"
  145. \&\fBopenssl\fR \fBts\fR
  146. \&\fB\-help\fR
  147. .PP
  148. \&\fBopenssl\fR \fBts\fR
  149. \&\fB\-query\fR
  150. [\fB\-config\fR \fIconfigfile\fR]
  151. [\fB\-data\fR \fIfile_to_hash\fR]
  152. [\fB\-digest\fR \fIdigest_bytes\fR]
  153. [\fB\-\f(BIdigest\fB\fR]
  154. [\fB\-tspolicy\fR \fIobject_id\fR]
  155. [\fB\-no_nonce\fR]
  156. [\fB\-cert\fR]
  157. [\fB\-in\fR \fIrequest.tsq\fR]
  158. [\fB\-out\fR \fIrequest.tsq\fR]
  159. [\fB\-text\fR]
  160. [\fB\-rand\fR \fIfiles\fR]
  161. [\fB\-writerand\fR \fIfile\fR]
  162. [\fB\-provider\fR \fIname\fR]
  163. [\fB\-provider\-path\fR \fIpath\fR]
  164. [\fB\-propquery\fR \fIpropq\fR]
  165. .PP
  166. \&\fBopenssl\fR \fBts\fR
  167. \&\fB\-reply\fR
  168. [\fB\-config\fR \fIconfigfile\fR]
  169. [\fB\-section\fR \fItsa_section\fR]
  170. [\fB\-queryfile\fR \fIrequest.tsq\fR]
  171. [\fB\-passin\fR \fIpassword_src\fR]
  172. [\fB\-signer\fR \fItsa_cert.pem\fR]
  173. [\fB\-inkey\fR \fIfilename\fR|\fIuri\fR]
  174. [\fB\-\f(BIdigest\fB\fR]
  175. [\fB\-chain\fR \fIcerts_file.pem\fR]
  176. [\fB\-tspolicy\fR \fIobject_id\fR]
  177. [\fB\-in\fR \fIresponse.tsr\fR]
  178. [\fB\-token_in\fR]
  179. [\fB\-out\fR \fIresponse.tsr\fR]
  180. [\fB\-token_out\fR]
  181. [\fB\-text\fR]
  182. [\fB\-engine\fR \fIid\fR]
  183. [\fB\-provider\fR \fIname\fR]
  184. [\fB\-provider\-path\fR \fIpath\fR]
  185. [\fB\-propquery\fR \fIpropq\fR]
  186. .PP
  187. \&\fBopenssl\fR \fBts\fR
  188. \&\fB\-verify\fR
  189. [\fB\-data\fR \fIfile_to_hash\fR]
  190. [\fB\-digest\fR \fIdigest_bytes\fR]
  191. [\fB\-queryfile\fR \fIrequest.tsq\fR]
  192. [\fB\-in\fR \fIresponse.tsr\fR]
  193. [\fB\-token_in\fR]
  194. [\fB\-untrusted\fR \fIfiles\fR|\fIuris\fR]
  195. [\fB\-CAfile\fR \fIfile\fR]
  196. [\fB\-CApath\fR \fIdir\fR]
  197. [\fB\-CAstore\fR \fIuri\fR]
  198. [\fB\-allow_proxy_certs\fR]
  199. [\fB\-attime\fR \fItimestamp\fR]
  200. [\fB\-no_check_time\fR]
  201. [\fB\-check_ss_sig\fR]
  202. [\fB\-crl_check\fR]
  203. [\fB\-crl_check_all\fR]
  204. [\fB\-explicit_policy\fR]
  205. [\fB\-extended_crl\fR]
  206. [\fB\-ignore_critical\fR]
  207. [\fB\-inhibit_any\fR]
  208. [\fB\-inhibit_map\fR]
  209. [\fB\-partial_chain\fR]
  210. [\fB\-policy\fR \fIarg\fR]
  211. [\fB\-policy_check\fR]
  212. [\fB\-policy_print\fR]
  213. [\fB\-purpose\fR \fIpurpose\fR]
  214. [\fB\-suiteB_128\fR]
  215. [\fB\-suiteB_128_only\fR]
  216. [\fB\-suiteB_192\fR]
  217. [\fB\-trusted_first\fR]
  218. [\fB\-no_alt_chains\fR]
  219. [\fB\-use_deltas\fR]
  220. [\fB\-auth_level\fR \fInum\fR]
  221. [\fB\-verify_depth\fR \fInum\fR]
  222. [\fB\-verify_email\fR \fIemail\fR]
  223. [\fB\-verify_hostname\fR \fIhostname\fR]
  224. [\fB\-verify_ip\fR \fIip\fR]
  225. [\fB\-verify_name\fR \fIname\fR]
  226. [\fB\-x509_strict\fR]
  227. [\fB\-issuer_checks\fR]
  228. [\fB\-provider\fR \fIname\fR]
  229. [\fB\-provider\-path\fR \fIpath\fR]
  230. [\fB\-propquery\fR \fIpropq\fR]
  231. .SH "DESCRIPTION"
  232. .IX Header "DESCRIPTION"
  233. This command is a basic Time Stamping Authority (\s-1TSA\s0) client and
  234. server application as specified in \s-1RFC 3161\s0 (Time-Stamp Protocol, \s-1TSP\s0). A
  235. \&\s-1TSA\s0 can be part of a \s-1PKI\s0 deployment and its role is to provide long
  236. term proof of the existence of a certain datum before a particular
  237. time. Here is a brief description of the protocol:
  238. .IP "1." 4
  239. The \s-1TSA\s0 client computes a one-way hash value for a data file and sends
  240. the hash to the \s-1TSA.\s0
  241. .IP "2." 4
  242. The \s-1TSA\s0 attaches the current date and time to the received hash value,
  243. signs them and sends the timestamp token back to the client. By
  244. creating this token the \s-1TSA\s0 certifies the existence of the original
  245. data file at the time of response generation.
  246. .IP "3." 4
  247. The \s-1TSA\s0 client receives the timestamp token and verifies the
  248. signature on it. It also checks if the token contains the same hash
  249. value that it had sent to the \s-1TSA.\s0
  250. .PP
  251. There is one \s-1DER\s0 encoded protocol data unit defined for transporting a
  252. timestamp request to the \s-1TSA\s0 and one for sending the timestamp response
  253. back to the client. This command has three main functions:
  254. creating a timestamp request based on a data file,
  255. creating a timestamp response based on a request, verifying if a
  256. response corresponds to a particular request or a data file.
  257. .PP
  258. There is no support for sending the requests/responses automatically
  259. over \s-1HTTP\s0 or \s-1TCP\s0 yet as suggested in \s-1RFC 3161.\s0 The users must send the
  260. requests either by ftp or e\-mail.
  261. .SH "OPTIONS"
  262. .IX Header "OPTIONS"
  263. .IP "\fB\-help\fR" 4
  264. .IX Item "-help"
  265. Print out a usage message.
  266. .IP "\fB\-query\fR" 4
  267. .IX Item "-query"
  268. Generate a \s-1TS\s0 query. For details see \*(L"Timestamp Request generation\*(R".
  269. .IP "\fB\-reply\fR" 4
  270. .IX Item "-reply"
  271. Generate a \s-1TS\s0 reply. For details see \*(L"Timestamp Response generation\*(R".
  272. .IP "\fB\-verify\fR" 4
  273. .IX Item "-verify"
  274. Verify a \s-1TS\s0 response. For details see \*(L"Timestamp Response verification\*(R".
  275. .SS "Timestamp Request generation"
  276. .IX Subsection "Timestamp Request generation"
  277. The \fB\-query\fR command can be used for creating and printing a timestamp
  278. request with the following options:
  279. .IP "\fB\-config\fR \fIconfigfile\fR" 4
  280. .IX Item "-config configfile"
  281. The configuration file to use.
  282. Optional; for a description of the default value,
  283. see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fBopenssl\fR\|(1).
  284. .IP "\fB\-data\fR \fIfile_to_hash\fR" 4
  285. .IX Item "-data file_to_hash"
  286. The data file for which the timestamp request needs to be
  287. created. stdin is the default if neither the \fB\-data\fR nor the \fB\-digest\fR
  288. parameter is specified. (Optional)
  289. .IP "\fB\-digest\fR \fIdigest_bytes\fR" 4
  290. .IX Item "-digest digest_bytes"
  291. It is possible to specify the message imprint explicitly without the data
  292. file. The imprint must be specified in a hexadecimal format, two characters
  293. per byte, the bytes optionally separated by colons (e.g. 1A:F6:01:... or
  294. 1AF601...). The number of bytes must match the message digest algorithm
  295. in use. (Optional)
  296. .IP "\fB\-\f(BIdigest\fB\fR" 4
  297. .IX Item "-digest"
  298. The message digest to apply to the data file.
  299. Any digest supported by the \fBopenssl\-dgst\fR\|(1) command can be used.
  300. The default is \s-1SHA\-256.\s0 (Optional)
  301. .IP "\fB\-tspolicy\fR \fIobject_id\fR" 4
  302. .IX Item "-tspolicy object_id"
  303. The policy that the client expects the \s-1TSA\s0 to use for creating the
  304. timestamp token. Either the dotted \s-1OID\s0 notation or \s-1OID\s0 names defined
  305. in the config file can be used. If no policy is requested the \s-1TSA\s0 will
  306. use its own default policy. (Optional)
  307. .IP "\fB\-no_nonce\fR" 4
  308. .IX Item "-no_nonce"
  309. No nonce is specified in the request if this option is
  310. given. Otherwise, a 64\-bit long pseudo-random nonce is
  311. included in the request. It is recommended to use a nonce to
  312. protect against replay attacks. (Optional)
  313. .IP "\fB\-cert\fR" 4
  314. .IX Item "-cert"
  315. The \s-1TSA\s0 is expected to include its signing certificate in the
  316. response. (Optional)
  317. .IP "\fB\-in\fR \fIrequest.tsq\fR" 4
  318. .IX Item "-in request.tsq"
  319. This option specifies a previously created timestamp request in \s-1DER\s0
  320. format that will be printed into the output file. Useful when you need
  321. to examine the content of a request in human-readable
  322. format. (Optional)
  323. .IP "\fB\-out\fR \fIrequest.tsq\fR" 4
  324. .IX Item "-out request.tsq"
  325. Name of the output file to which the request will be written. Default
  326. is stdout. (Optional)
  327. .IP "\fB\-text\fR" 4
  328. .IX Item "-text"
  329. If this option is specified the output is human-readable text format
  330. instead of \s-1DER.\s0 (Optional)
  331. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
  332. .IX Item "-rand files, -writerand file"
  333. See \*(L"Random State Options\*(R" in \fBopenssl\fR\|(1) for details.
  334. .SS "Timestamp Response generation"
  335. .IX Subsection "Timestamp Response generation"
  336. A timestamp response (TimeStampResp) consists of a response status
  337. and the timestamp token itself (ContentInfo), if the token generation was
  338. successful. The \fB\-reply\fR command is for creating a timestamp
  339. response or timestamp token based on a request and printing the
  340. response/token in human-readable format. If \fB\-token_out\fR is not
  341. specified the output is always a timestamp response (TimeStampResp),
  342. otherwise it is a timestamp token (ContentInfo).
  343. .IP "\fB\-config\fR \fIconfigfile\fR" 4
  344. .IX Item "-config configfile"
  345. The configuration file to use.
  346. Optional; for a description of the default value,
  347. see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fBopenssl\fR\|(1).
  348. See \*(L"\s-1CONFIGURATION FILE OPTIONS\*(R"\s0 for configurable variables.
  349. .IP "\fB\-section\fR \fItsa_section\fR" 4
  350. .IX Item "-section tsa_section"
  351. The name of the config file section containing the settings for the
  352. response generation. If not specified the default \s-1TSA\s0 section is
  353. used, see \*(L"\s-1CONFIGURATION FILE OPTIONS\*(R"\s0 for details. (Optional)
  354. .IP "\fB\-queryfile\fR \fIrequest.tsq\fR" 4
  355. .IX Item "-queryfile request.tsq"
  356. The name of the file containing a \s-1DER\s0 encoded timestamp request. (Optional)
  357. .IP "\fB\-passin\fR \fIpassword_src\fR" 4
  358. .IX Item "-passin password_src"
  359. Specifies the password source for the private key of the \s-1TSA.\s0 See
  360. description in \fBopenssl\fR\|(1). (Optional)
  361. .IP "\fB\-signer\fR \fItsa_cert.pem\fR" 4
  362. .IX Item "-signer tsa_cert.pem"
  363. The signer certificate of the \s-1TSA\s0 in \s-1PEM\s0 format. The \s-1TSA\s0 signing
  364. certificate must have exactly one extended key usage assigned to it:
  365. timeStamping. The extended key usage must also be critical, otherwise
  366. the certificate is going to be refused. Overrides the \fBsigner_cert\fR
  367. variable of the config file. (Optional)
  368. .IP "\fB\-inkey\fR \fIfilename\fR|\fIuri\fR" 4
  369. .IX Item "-inkey filename|uri"
  370. The signer private key of the \s-1TSA\s0 in \s-1PEM\s0 format. Overrides the
  371. \&\fBsigner_key\fR config file option. (Optional)
  372. .IP "\fB\-\f(BIdigest\fB\fR" 4
  373. .IX Item "-digest"
  374. Signing digest to use. Overrides the \fBsigner_digest\fR config file
  375. option. (Mandatory unless specified in the config file)
  376. .IP "\fB\-chain\fR \fIcerts_file.pem\fR" 4
  377. .IX Item "-chain certs_file.pem"
  378. The collection of certificates in \s-1PEM\s0 format that will all
  379. be included in the response in addition to the signer certificate if
  380. the \fB\-cert\fR option was used for the request. This file is supposed to
  381. contain the certificate chain for the signer certificate from its
  382. issuer upwards. The \fB\-reply\fR command does not build a certificate
  383. chain automatically. (Optional)
  384. .IP "\fB\-tspolicy\fR \fIobject_id\fR" 4
  385. .IX Item "-tspolicy object_id"
  386. The default policy to use for the response unless the client
  387. explicitly requires a particular \s-1TSA\s0 policy. The \s-1OID\s0 can be specified
  388. either in dotted notation or with its name. Overrides the
  389. \&\fBdefault_policy\fR config file option. (Optional)
  390. .IP "\fB\-in\fR \fIresponse.tsr\fR" 4
  391. .IX Item "-in response.tsr"
  392. Specifies a previously created timestamp response or timestamp token
  393. (if \fB\-token_in\fR is also specified) in \s-1DER\s0 format that will be written
  394. to the output file. This option does not require a request, it is
  395. useful e.g. when you need to examine the content of a response or
  396. token or you want to extract the timestamp token from a response. If
  397. the input is a token and the output is a timestamp response a default
  398. \&'granted' status info is added to the token. (Optional)
  399. .IP "\fB\-token_in\fR" 4
  400. .IX Item "-token_in"
  401. This flag can be used together with the \fB\-in\fR option and indicates
  402. that the input is a \s-1DER\s0 encoded timestamp token (ContentInfo) instead
  403. of a timestamp response (TimeStampResp). (Optional)
  404. .IP "\fB\-out\fR \fIresponse.tsr\fR" 4
  405. .IX Item "-out response.tsr"
  406. The response is written to this file. The format and content of the
  407. file depends on other options (see \fB\-text\fR, \fB\-token_out\fR). The default is
  408. stdout. (Optional)
  409. .IP "\fB\-token_out\fR" 4
  410. .IX Item "-token_out"
  411. The output is a timestamp token (ContentInfo) instead of timestamp
  412. response (TimeStampResp). (Optional)
  413. .IP "\fB\-text\fR" 4
  414. .IX Item "-text"
  415. If this option is specified the output is human-readable text format
  416. instead of \s-1DER.\s0 (Optional)
  417. .IP "\fB\-engine\fR \fIid\fR" 4
  418. .IX Item "-engine id"
  419. See \*(L"Engine Options\*(R" in \fBopenssl\fR\|(1).
  420. This option is deprecated.
  421. .IP "\fB\-provider\fR \fIname\fR" 4
  422. .IX Item "-provider name"
  423. .PD 0
  424. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  425. .IX Item "-provider-path path"
  426. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  427. .IX Item "-propquery propq"
  428. .PD
  429. See \*(L"Provider Options\*(R" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  430. .SS "Timestamp Response verification"
  431. .IX Subsection "Timestamp Response verification"
  432. The \fB\-verify\fR command is for verifying if a timestamp response or
  433. timestamp token is valid and matches a particular timestamp request or
  434. data file. The \fB\-verify\fR command does not use the configuration file.
  435. .IP "\fB\-data\fR \fIfile_to_hash\fR" 4
  436. .IX Item "-data file_to_hash"
  437. The response or token must be verified against file_to_hash. The file
  438. is hashed with the message digest algorithm specified in the token.
  439. The \fB\-digest\fR and \fB\-queryfile\fR options must not be specified with this one.
  440. (Optional)
  441. .IP "\fB\-digest\fR \fIdigest_bytes\fR" 4
  442. .IX Item "-digest digest_bytes"
  443. The response or token must be verified against the message digest specified
  444. with this option. The number of bytes must match the message digest algorithm
  445. specified in the token. The \fB\-data\fR and \fB\-queryfile\fR options must not be
  446. specified with this one. (Optional)
  447. .IP "\fB\-queryfile\fR \fIrequest.tsq\fR" 4
  448. .IX Item "-queryfile request.tsq"
  449. The original timestamp request in \s-1DER\s0 format. The \fB\-data\fR and \fB\-digest\fR
  450. options must not be specified with this one. (Optional)
  451. .IP "\fB\-in\fR \fIresponse.tsr\fR" 4
  452. .IX Item "-in response.tsr"
  453. The timestamp response that needs to be verified in \s-1DER\s0 format. (Mandatory)
  454. .IP "\fB\-token_in\fR" 4
  455. .IX Item "-token_in"
  456. This flag can be used together with the \fB\-in\fR option and indicates
  457. that the input is a \s-1DER\s0 encoded timestamp token (ContentInfo) instead
  458. of a timestamp response (TimeStampResp). (Optional)
  459. .IP "\fB\-untrusted\fR \fIfiles\fR|\fIuris\fR" 4
  460. .IX Item "-untrusted files|uris"
  461. A set of additional untrusted certificates which may be
  462. needed when building the certificate chain for the \s-1TSA\s0's signing certificate.
  463. These do not need to contain the \s-1TSA\s0 signing certificate and intermediate \s-1CA\s0
  464. certificates as far as the response already includes them.
  465. (Optional)
  466. .Sp
  467. Multiple sources may be given, separated by commas and/or whitespace.
  468. Each file may contain multiple certificates.
  469. .IP "\fB\-CAfile\fR \fIfile\fR, \fB\-CApath\fR \fIdir\fR, \fB\-CAstore\fR \fIuri\fR" 4
  470. .IX Item "-CAfile file, -CApath dir, -CAstore uri"
  471. See \*(L"Trusted Certificate Options\*(R" in \fBopenssl\-verification\-options\fR\|(1) for details.
  472. At least one of \fB\-CAfile\fR, \fB\-CApath\fR or \fB\-CAstore\fR must be specified.
  473. .IP "\fB\-allow_proxy_certs\fR, \fB\-attime\fR, \fB\-no_check_time\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR, \fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR, \fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-no_alt_chains\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR, \fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR, \fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR, \fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR, \fB\-verify_name\fR, \fB\-x509_strict\fR \fB\-issuer_checks\fR" 4
  474. .IX Item "-allow_proxy_certs, -attime, -no_check_time, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict -issuer_checks"
  475. Set various options of certificate chain verification.
  476. See \*(L"Verification Options\*(R" in \fBopenssl\-verification\-options\fR\|(1) for details.
  477. .Sp
  478. Any verification errors cause the command to exit.
  479. .SH "CONFIGURATION FILE OPTIONS"
  480. .IX Header "CONFIGURATION FILE OPTIONS"
  481. The \fB\-query\fR and \fB\-reply\fR commands make use of a configuration file.
  482. See \fBconfig\fR\|(5)
  483. for a general description of the syntax of the config file. The
  484. \&\fB\-query\fR command uses only the symbolic \s-1OID\s0 names section
  485. and it can work without it. However, the \fB\-reply\fR command needs the
  486. config file for its operation.
  487. .PP
  488. When there is a command line switch equivalent of a variable the
  489. switch always overrides the settings in the config file.
  490. .IP "\fBtsa\fR section, \fBdefault_tsa\fR" 4
  491. .IX Item "tsa section, default_tsa"
  492. This is the main section and it specifies the name of another section
  493. that contains all the options for the \fB\-reply\fR command. This default
  494. section can be overridden with the \fB\-section\fR command line switch. (Optional)
  495. .IP "\fBoid_file\fR" 4
  496. .IX Item "oid_file"
  497. This specifies a file containing additional \fB\s-1OBJECT IDENTIFIERS\s0\fR.
  498. Each line of the file should consist of the numerical form of the
  499. object identifier followed by whitespace then the short name followed
  500. by whitespace and finally the long name. (Optional)
  501. .IP "\fBoid_section\fR" 4
  502. .IX Item "oid_section"
  503. This specifies a section in the configuration file containing extra
  504. object identifiers. Each line should consist of the short name of the
  505. object identifier followed by \fB=\fR and the numerical form. The short
  506. and long names are the same when this option is used. (Optional)
  507. .IP "\fB\s-1RANDFILE\s0\fR" 4
  508. .IX Item "RANDFILE"
  509. At startup the specified file is loaded into the random number generator,
  510. and at exit 256 bytes will be written to it. (Note: Using a \s-1RANDFILE\s0 is
  511. not necessary anymore, see the \*(L"\s-1HISTORY\*(R"\s0 section.
  512. .IP "\fBserial\fR" 4
  513. .IX Item "serial"
  514. The name of the file containing the hexadecimal serial number of the
  515. last timestamp response created. This number is incremented by 1 for
  516. each response. If the file does not exist at the time of response
  517. generation a new file is created with serial number 1. (Mandatory)
  518. .IP "\fBcrypto_device\fR" 4
  519. .IX Item "crypto_device"
  520. Specifies the OpenSSL engine that will be set as the default for
  521. all available algorithms. The default value is built-in, you can specify
  522. any other engines supported by OpenSSL (e.g. use chil for the NCipher \s-1HSM\s0).
  523. (Optional)
  524. .IP "\fBsigner_cert\fR" 4
  525. .IX Item "signer_cert"
  526. \&\s-1TSA\s0 signing certificate in \s-1PEM\s0 format. The same as the \fB\-signer\fR
  527. command line option. (Optional)
  528. .IP "\fBcerts\fR" 4
  529. .IX Item "certs"
  530. A file containing a set of \s-1PEM\s0 encoded certificates that need to be
  531. included in the response. The same as the \fB\-chain\fR command line
  532. option. (Optional)
  533. .IP "\fBsigner_key\fR" 4
  534. .IX Item "signer_key"
  535. The private key of the \s-1TSA\s0 in \s-1PEM\s0 format. The same as the \fB\-inkey\fR
  536. command line option. (Optional)
  537. .IP "\fBsigner_digest\fR" 4
  538. .IX Item "signer_digest"
  539. Signing digest to use. The same as the
  540. \&\fB\-\f(BIdigest\fB\fR command line option. (Mandatory unless specified on the command
  541. line)
  542. .IP "\fBdefault_policy\fR" 4
  543. .IX Item "default_policy"
  544. The default policy to use when the request does not mandate any
  545. policy. The same as the \fB\-tspolicy\fR command line option. (Optional)
  546. .IP "\fBother_policies\fR" 4
  547. .IX Item "other_policies"
  548. Comma separated list of policies that are also acceptable by the \s-1TSA\s0
  549. and used only if the request explicitly specifies one of them. (Optional)
  550. .IP "\fBdigests\fR" 4
  551. .IX Item "digests"
  552. The list of message digest algorithms that the \s-1TSA\s0 accepts. At least
  553. one algorithm must be specified. (Mandatory)
  554. .IP "\fBaccuracy\fR" 4
  555. .IX Item "accuracy"
  556. The accuracy of the time source of the \s-1TSA\s0 in seconds, milliseconds
  557. and microseconds. E.g. secs:1, millisecs:500, microsecs:100. If any of
  558. the components is missing zero is assumed for that field. (Optional)
  559. .IP "\fBclock_precision_digits\fR" 4
  560. .IX Item "clock_precision_digits"
  561. Specifies the maximum number of digits, which represent the fraction of
  562. seconds, that need to be included in the time field. The trailing zeros
  563. must be removed from the time, so there might actually be fewer digits,
  564. or no fraction of seconds at all. Supported only on \s-1UNIX\s0 platforms.
  565. The maximum value is 6, default is 0.
  566. (Optional)
  567. .IP "\fBordering\fR" 4
  568. .IX Item "ordering"
  569. If this option is yes the responses generated by this \s-1TSA\s0 can always
  570. be ordered, even if the time difference between two responses is less
  571. than the sum of their accuracies. Default is no. (Optional)
  572. .IP "\fBtsa_name\fR" 4
  573. .IX Item "tsa_name"
  574. Set this option to yes if the subject name of the \s-1TSA\s0 must be included in
  575. the \s-1TSA\s0 name field of the response. Default is no. (Optional)
  576. .IP "\fBess_cert_id_chain\fR" 4
  577. .IX Item "ess_cert_id_chain"
  578. The SignedData objects created by the \s-1TSA\s0 always contain the
  579. certificate identifier of the signing certificate in a signed
  580. attribute (see \s-1RFC 2634,\s0 Enhanced Security Services).
  581. If this variable is set to no, only this signing certificate identifier
  582. is included in the SigningCertificate signed attribute.
  583. If this variable is set to yes and the \fBcerts\fR variable or the \fB\-chain\fR option
  584. is specified then the certificate identifiers of the chain will also
  585. be included, where the \fB\-chain\fR option overrides the \fBcerts\fR variable.
  586. Default is no. (Optional)
  587. .IP "\fBess_cert_id_alg\fR" 4
  588. .IX Item "ess_cert_id_alg"
  589. This option specifies the hash function to be used to calculate the \s-1TSA\s0's
  590. public key certificate identifier. Default is sha256. (Optional)
  591. .SH "EXAMPLES"
  592. .IX Header "EXAMPLES"
  593. All the examples below presume that \fB\s-1OPENSSL_CONF\s0\fR is set to a proper
  594. configuration file, e.g. the example configuration file
  595. \&\fIopenssl/apps/openssl.cnf\fR will do.
  596. .SS "Timestamp Request"
  597. .IX Subsection "Timestamp Request"
  598. To create a timestamp request for \fIdesign1.txt\fR with \s-1SHA\-256\s0 digest,
  599. without nonce and policy, and without requirement for a certificate
  600. in the response:
  601. .PP
  602. .Vb 2
  603. \& openssl ts \-query \-data design1.txt \-no_nonce \e
  604. \& \-out design1.tsq
  605. .Ve
  606. .PP
  607. To create a similar timestamp request with specifying the message imprint
  608. explicitly:
  609. .PP
  610. .Vb 2
  611. \& openssl ts \-query \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
  612. \& \-no_nonce \-out design1.tsq
  613. .Ve
  614. .PP
  615. To print the content of the previous request in human readable format:
  616. .PP
  617. .Vb 1
  618. \& openssl ts \-query \-in design1.tsq \-text
  619. .Ve
  620. .PP
  621. To create a timestamp request which includes the \s-1SHA\-512\s0 digest
  622. of \fIdesign2.txt\fR, requests the signer certificate and nonce, and
  623. specifies a policy id (assuming the tsa_policy1 name is defined in the
  624. \&\s-1OID\s0 section of the config file):
  625. .PP
  626. .Vb 2
  627. \& openssl ts \-query \-data design2.txt \-sha512 \e
  628. \& \-tspolicy tsa_policy1 \-cert \-out design2.tsq
  629. .Ve
  630. .SS "Timestamp Response"
  631. .IX Subsection "Timestamp Response"
  632. Before generating a response a signing certificate must be created for
  633. the \s-1TSA\s0 that contains the \fBtimeStamping\fR critical extended key usage extension
  634. without any other key usage extensions. You can add this line to the
  635. user certificate section of the config file to generate a proper certificate;
  636. .PP
  637. .Vb 1
  638. \& extendedKeyUsage = critical,timeStamping
  639. .Ve
  640. .PP
  641. See \fBopenssl\-req\fR\|(1), \fBopenssl\-ca\fR\|(1), and \fBopenssl\-x509\fR\|(1) for
  642. instructions. The examples below assume that \fIcacert.pem\fR contains the
  643. certificate of the \s-1CA,\s0 \fItsacert.pem\fR is the signing certificate issued
  644. by \fIcacert.pem\fR and \fItsakey.pem\fR is the private key of the \s-1TSA.\s0
  645. .PP
  646. To create a timestamp response for a request:
  647. .PP
  648. .Vb 2
  649. \& openssl ts \-reply \-queryfile design1.tsq \-inkey tsakey.pem \e
  650. \& \-signer tsacert.pem \-out design1.tsr
  651. .Ve
  652. .PP
  653. If you want to use the settings in the config file you could just write:
  654. .PP
  655. .Vb 1
  656. \& openssl ts \-reply \-queryfile design1.tsq \-out design1.tsr
  657. .Ve
  658. .PP
  659. To print a timestamp reply to stdout in human readable format:
  660. .PP
  661. .Vb 1
  662. \& openssl ts \-reply \-in design1.tsr \-text
  663. .Ve
  664. .PP
  665. To create a timestamp token instead of timestamp response:
  666. .PP
  667. .Vb 1
  668. \& openssl ts \-reply \-queryfile design1.tsq \-out design1_token.der \-token_out
  669. .Ve
  670. .PP
  671. To print a timestamp token to stdout in human readable format:
  672. .PP
  673. .Vb 1
  674. \& openssl ts \-reply \-in design1_token.der \-token_in \-text \-token_out
  675. .Ve
  676. .PP
  677. To extract the timestamp token from a response:
  678. .PP
  679. .Vb 1
  680. \& openssl ts \-reply \-in design1.tsr \-out design1_token.der \-token_out
  681. .Ve
  682. .PP
  683. To add 'granted' status info to a timestamp token thereby creating a
  684. valid response:
  685. .PP
  686. .Vb 1
  687. \& openssl ts \-reply \-in design1_token.der \-token_in \-out design1.tsr
  688. .Ve
  689. .SS "Timestamp Verification"
  690. .IX Subsection "Timestamp Verification"
  691. To verify a timestamp reply against a request:
  692. .PP
  693. .Vb 2
  694. \& openssl ts \-verify \-queryfile design1.tsq \-in design1.tsr \e
  695. \& \-CAfile cacert.pem \-untrusted tsacert.pem
  696. .Ve
  697. .PP
  698. To verify a timestamp reply that includes the certificate chain:
  699. .PP
  700. .Vb 2
  701. \& openssl ts \-verify \-queryfile design2.tsq \-in design2.tsr \e
  702. \& \-CAfile cacert.pem
  703. .Ve
  704. .PP
  705. To verify a timestamp token against the original data file:
  706. openssl ts \-verify \-data design2.txt \-in design2.tsr \e
  707. \-CAfile cacert.pem
  708. .PP
  709. To verify a timestamp token against a message imprint:
  710. openssl ts \-verify \-digest b7e5d3f93198b38379852f2c04e78d73abdd0f4b \e
  711. \-in design2.tsr \-CAfile cacert.pem
  712. .PP
  713. You could also look at the 'test' directory for more examples.
  714. .SH "BUGS"
  715. .IX Header "BUGS"
  716. .IP "\(bu" 2
  717. No support for timestamps over \s-1SMTP,\s0 though it is quite easy
  718. to implement an automatic e\-mail based \s-1TSA\s0 with \fBprocmail\fR\|(1)
  719. and \fBperl\fR\|(1). \s-1HTTP\s0 server support is provided in the form of
  720. a separate apache module. \s-1HTTP\s0 client support is provided by
  721. \&\fBtsget\fR\|(1). Pure \s-1TCP/IP\s0 protocol is not supported.
  722. .IP "\(bu" 2
  723. The file containing the last serial number of the \s-1TSA\s0 is not
  724. locked when being read or written. This is a problem if more than one
  725. instance of \fBopenssl\fR\|(1) is trying to create a timestamp
  726. response at the same time. This is not an issue when using the apache
  727. server module, it does proper locking.
  728. .IP "\(bu" 2
  729. Look for the \s-1FIXME\s0 word in the source files.
  730. .IP "\(bu" 2
  731. The source code should really be reviewed by somebody else, too.
  732. .IP "\(bu" 2
  733. More testing is needed, I have done only some basic tests (see
  734. test/testtsa).
  735. .SH "HISTORY"
  736. .IX Header "HISTORY"
  737. OpenSSL 1.1.1 introduced a new random generator (\s-1CSPRNG\s0) with an improved
  738. seeding mechanism. The new seeding mechanism makes it unnecessary to
  739. define a \s-1RANDFILE\s0 for saving and restoring randomness. This option is
  740. retained mainly for compatibility reasons.
  741. .PP
  742. The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
  743. .SH "SEE ALSO"
  744. .IX Header "SEE ALSO"
  745. \&\fBopenssl\fR\|(1),
  746. \&\fBtsget\fR\|(1),
  747. \&\fBopenssl\-req\fR\|(1),
  748. \&\fBopenssl\-x509\fR\|(1),
  749. \&\fBopenssl\-ca\fR\|(1),
  750. \&\fBopenssl\-genrsa\fR\|(1),
  751. \&\fBconfig\fR\|(5),
  752. \&\fBossl_store\-file\fR\|(7)
  753. .SH "COPYRIGHT"
  754. .IX Header "COPYRIGHT"
  755. Copyright 2006\-2024 The OpenSSL Project Authors. All Rights Reserved.
  756. .PP
  757. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  758. this file except in compliance with the License. You can obtain a copy
  759. in the file \s-1LICENSE\s0 in the source distribution or at
  760. <https://www.openssl.org/source/license.html>.