openssl-ts.1ossl 27 KB

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