diff options
Diffstat (limited to 'src/usr.bin/openssl/openssl.1')
-rw-r--r-- | src/usr.bin/openssl/openssl.1 | 6827 |
1 files changed, 0 insertions, 6827 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1 deleted file mode 100644 index a095c01f0a..0000000000 --- a/src/usr.bin/openssl/openssl.1 +++ /dev/null | |||
@@ -1,6827 +0,0 @@ | |||
1 | .\" $OpenBSD: openssl.1,v 1.163 2025/04/14 08:40:10 tb Exp $ | ||
2 | .\" ==================================================================== | ||
3 | .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | ||
4 | .\" | ||
5 | .\" Redistribution and use in source and binary forms, with or without | ||
6 | .\" modification, are permitted provided that the following conditions | ||
7 | .\" are met: | ||
8 | .\" | ||
9 | .\" 1. Redistributions of source code must retain the above copyright | ||
10 | .\" notice, this list of conditions and the following disclaimer. | ||
11 | .\" | ||
12 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
13 | .\" notice, this list of conditions and the following disclaimer in | ||
14 | .\" the documentation and/or other materials provided with the | ||
15 | .\" distribution. | ||
16 | .\" | ||
17 | .\" 3. All advertising materials mentioning features or use of this | ||
18 | .\" software must display the following acknowledgment: | ||
19 | .\" "This product includes software developed by the OpenSSL Project | ||
20 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
21 | .\" | ||
22 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
23 | .\" endorse or promote products derived from this software without | ||
24 | .\" prior written permission. For written permission, please contact | ||
25 | .\" openssl-core@openssl.org. | ||
26 | .\" | ||
27 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
28 | .\" nor may "OpenSSL" appear in their names without prior written | ||
29 | .\" permission of the OpenSSL Project. | ||
30 | .\" | ||
31 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
32 | .\" acknowledgment: | ||
33 | .\" "This product includes software developed by the OpenSSL Project | ||
34 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
35 | .\" | ||
36 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
37 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
38 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
39 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
40 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
41 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
42 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
43 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
44 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
45 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
46 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
47 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
48 | .\" ==================================================================== | ||
49 | .\" | ||
50 | .\" This product includes cryptographic software written by Eric Young | ||
51 | .\" (eay@cryptsoft.com). This product includes software written by Tim | ||
52 | .\" Hudson (tjh@cryptsoft.com). | ||
53 | .\" | ||
54 | .\" | ||
55 | .\" Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
56 | .\" All rights reserved. | ||
57 | .\" | ||
58 | .\" This package is an SSL implementation written | ||
59 | .\" by Eric Young (eay@cryptsoft.com). | ||
60 | .\" The implementation was written so as to conform with Netscapes SSL. | ||
61 | .\" | ||
62 | .\" This library is free for commercial and non-commercial use as long as | ||
63 | .\" the following conditions are aheared to. The following conditions | ||
64 | .\" apply to all code found in this distribution, be it the RC4, RSA, | ||
65 | .\" lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
66 | .\" included with this distribution is covered by the same copyright terms | ||
67 | .\" except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
68 | .\" | ||
69 | .\" Copyright remains Eric Young's, and as such any Copyright notices in | ||
70 | .\" the code are not to be removed. | ||
71 | .\" If this package is used in a product, Eric Young should be given attribution | ||
72 | .\" as the author of the parts of the library used. | ||
73 | .\" This can be in the form of a textual message at program startup or | ||
74 | .\" in documentation (online or textual) provided with the package. | ||
75 | .\" | ||
76 | .\" Redistribution and use in source and binary forms, with or without | ||
77 | .\" modification, are permitted provided that the following conditions | ||
78 | .\" are met: | ||
79 | .\" 1. Redistributions of source code must retain the copyright | ||
80 | .\" notice, this list of conditions and the following disclaimer. | ||
81 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
82 | .\" notice, this list of conditions and the following disclaimer in the | ||
83 | .\" documentation and/or other materials provided with the distribution. | ||
84 | .\" 3. All advertising materials mentioning features or use of this software | ||
85 | .\" must display the following acknowledgement: | ||
86 | .\" "This product includes cryptographic software written by | ||
87 | .\" Eric Young (eay@cryptsoft.com)" | ||
88 | .\" The word 'cryptographic' can be left out if the rouines from the library | ||
89 | .\" being used are not cryptographic related :-). | ||
90 | .\" 4. If you include any Windows specific code (or a derivative thereof) from | ||
91 | .\" the apps directory (application code) you must include an | ||
92 | .\" acknowledgement: | ||
93 | .\" "This product includes software written by Tim Hudson | ||
94 | .\" (tjh@cryptsoft.com)" | ||
95 | .\" | ||
96 | .\" THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
97 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
98 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
99 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
100 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
101 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
102 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
103 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
104 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
105 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
106 | .\" SUCH DAMAGE. | ||
107 | .\" | ||
108 | .\" The licence and distribution terms for any publically available version or | ||
109 | .\" derivative of this code cannot be changed. i.e. this code cannot simply be | ||
110 | .\" copied and put under another distribution licence | ||
111 | .\" [including the GNU Public Licence.] | ||
112 | .\" | ||
113 | .Dd $Mdocdate: April 14 2025 $ | ||
114 | .Dt OPENSSL 1 | ||
115 | .Os | ||
116 | .Sh NAME | ||
117 | .Nm openssl | ||
118 | .Nd OpenSSL command line tool | ||
119 | .Sh SYNOPSIS | ||
120 | .Nm | ||
121 | .Ar command | ||
122 | .Op Ar command_opt ... | ||
123 | .Op Ar command_arg ... | ||
124 | .Pp | ||
125 | .Nm | ||
126 | .Cm list-standard-commands | | ||
127 | .Cm list-message-digest-commands | | ||
128 | .Cm list-cipher-commands | | ||
129 | .Cm list-cipher-algorithms | | ||
130 | .Cm list-message-digest-algorithms | | ||
131 | .Cm list-public-key-algorithms | ||
132 | .Pp | ||
133 | .Nm | ||
134 | .Cm no- Ns Ar command | ||
135 | .Sh DESCRIPTION | ||
136 | .Nm OpenSSL | ||
137 | is a cryptography toolkit implementing the | ||
138 | Transport Layer Security | ||
139 | .Pq TLS | ||
140 | network protocol, | ||
141 | as well as related cryptography standards. | ||
142 | .Pp | ||
143 | The | ||
144 | .Nm | ||
145 | program is a command line tool for using the various | ||
146 | cryptography functions of | ||
147 | .Nm openssl Ns 's | ||
148 | crypto library from the shell. | ||
149 | .Pp | ||
150 | The pseudo-commands | ||
151 | .Cm list-standard-commands , list-message-digest-commands , | ||
152 | and | ||
153 | .Cm list-cipher-commands | ||
154 | output a list | ||
155 | .Pq one entry per line | ||
156 | of the names of all standard commands, message digest commands, | ||
157 | or cipher commands, respectively, that are available in the present | ||
158 | .Nm | ||
159 | utility. | ||
160 | .Pp | ||
161 | The pseudo-commands | ||
162 | .Cm list-cipher-algorithms | ||
163 | and | ||
164 | .Cm list-message-digest-algorithms | ||
165 | list all cipher and message digest names, | ||
166 | one entry per line. | ||
167 | Aliases are listed as: | ||
168 | .Pp | ||
169 | .D1 from => to | ||
170 | .Pp | ||
171 | The pseudo-command | ||
172 | .Cm list-public-key-algorithms | ||
173 | lists all supported public key algorithms. | ||
174 | .Pp | ||
175 | The pseudo-command | ||
176 | .Cm no- Ns Ar command | ||
177 | tests whether a command of the | ||
178 | specified name is available. | ||
179 | If | ||
180 | .Ar command | ||
181 | does not exist, | ||
182 | it returns 0 | ||
183 | and prints | ||
184 | .Cm no- Ns Ar command ; | ||
185 | otherwise it returns 1 and prints | ||
186 | .Ar command . | ||
187 | In both cases, the output goes to stdout and nothing is printed to stderr. | ||
188 | Additional command line arguments are always ignored. | ||
189 | Since for each cipher there is a command of the same name, | ||
190 | this provides an easy way for shell scripts to test for the | ||
191 | availability of ciphers in the | ||
192 | .Nm | ||
193 | program. | ||
194 | .Pp | ||
195 | .Sy Note : | ||
196 | .Cm no- Ns Ar command | ||
197 | is not able to detect pseudo-commands such as | ||
198 | .Cm quit , | ||
199 | .Cm list- Ns Ar ... Ns Cm -commands , | ||
200 | or | ||
201 | .Cm no- Ns Ar command | ||
202 | itself. | ||
203 | .Tg asn1parse | ||
204 | .Sh ASN1PARSE | ||
205 | .Bl -hang -width "openssl asn1parse" | ||
206 | .It Nm openssl asn1parse | ||
207 | .Bk -words | ||
208 | .Op Fl i | ||
209 | .Op Fl dlimit Ar number | ||
210 | .Op Fl dump | ||
211 | .Op Fl genconf Ar file | ||
212 | .Op Fl genstr Ar str | ||
213 | .Op Fl in Ar file | ||
214 | .Op Fl inform Cm der | pem | txt | ||
215 | .Op Fl length Ar number | ||
216 | .Op Fl noout | ||
217 | .Op Fl offset Ar number | ||
218 | .Op Fl oid Ar file | ||
219 | .Op Fl out Ar file | ||
220 | .Op Fl strparse Ar offset | ||
221 | .Ek | ||
222 | .El | ||
223 | .Pp | ||
224 | The | ||
225 | .Nm asn1parse | ||
226 | command is a diagnostic utility that can parse ASN.1 structures. | ||
227 | It can also be used to extract data from ASN.1 formatted data. | ||
228 | .Pp | ||
229 | The options are as follows: | ||
230 | .Bl -tag -width Ds | ||
231 | .It Fl dlimit Ar number | ||
232 | Dump the first | ||
233 | .Ar number | ||
234 | bytes of unknown data in hex form. | ||
235 | .It Fl dump | ||
236 | Dump unknown data in hex form. | ||
237 | .It Fl genconf Ar file , Fl genstr Ar str | ||
238 | Generate encoded data based on string | ||
239 | .Ar str , | ||
240 | file | ||
241 | .Ar file , | ||
242 | or both, using the format described in | ||
243 | .Xr ASN1_generate_nconf 3 . | ||
244 | If only | ||
245 | .Ar file | ||
246 | is present then the string is obtained from the default section | ||
247 | using the name | ||
248 | .Dq asn1 . | ||
249 | The encoded data is passed through the ASN.1 parser and printed out as | ||
250 | though it came from a file; | ||
251 | the contents can thus be examined and written to a file using the | ||
252 | .Fl out | ||
253 | option. | ||
254 | .It Fl i | ||
255 | Indent the output according to the | ||
256 | .Qq depth | ||
257 | of the structures. | ||
258 | .It Fl in Ar file | ||
259 | The input file to read from, or standard input if not specified. | ||
260 | .It Fl inform Cm der | pem | txt | ||
261 | The input format. | ||
262 | .It Fl length Ar number | ||
263 | Number of bytes to parse; the default is until end of file. | ||
264 | .It Fl noout | ||
265 | Do not output the parsed version of the input file. | ||
266 | .It Fl offset Ar number | ||
267 | Starting offset to begin parsing; the default is start of file. | ||
268 | .It Fl oid Ar file | ||
269 | A file containing additional object identifiers | ||
270 | .Pq OIDs . | ||
271 | If an OID | ||
272 | .Pq object identifier | ||
273 | is not part of | ||
274 | .Nm openssl Ns 's | ||
275 | internal table, it will be represented in | ||
276 | numerical form | ||
277 | .Pq for example 1.2.3.4 . | ||
278 | .Pp | ||
279 | Each line consists of three columns: | ||
280 | the first column is the OID in numerical format and should be followed by | ||
281 | whitespace. | ||
282 | The second column is the | ||
283 | .Qq short name , | ||
284 | which is a single word followed by whitespace. | ||
285 | The final column is the rest of the line and is the | ||
286 | .Qq long name . | ||
287 | .Nm asn1parse | ||
288 | displays the long name. | ||
289 | .It Fl out Ar file | ||
290 | The DER-encoded output file; the default is no encoded output | ||
291 | (useful when combined with | ||
292 | .Fl strparse ) . | ||
293 | .It Fl strparse Ar offset | ||
294 | Parse the content octets of the ASN.1 object starting at | ||
295 | .Ar offset . | ||
296 | This option can be used multiple times to | ||
297 | .Qq drill down | ||
298 | into a nested structure. | ||
299 | .El | ||
300 | .Tg ca | ||
301 | .Sh CA | ||
302 | .Bl -hang -width "openssl ca" | ||
303 | .It Nm openssl ca | ||
304 | .Bk -words | ||
305 | .Op Fl batch | ||
306 | .Op Fl cert Ar file | ||
307 | .Op Fl config Ar file | ||
308 | .Op Fl create_serial | ||
309 | .Op Fl crl_CA_compromise Ar time | ||
310 | .Op Fl crl_compromise Ar time | ||
311 | .Op Fl crl_hold Ar instruction | ||
312 | .Op Fl crl_reason Ar reason | ||
313 | .Op Fl crldays Ar days | ||
314 | .Op Fl crlexts Ar section | ||
315 | .Op Fl crlhours Ar hours | ||
316 | .Op Fl crlsec Ar seconds | ||
317 | .Op Fl days Ar arg | ||
318 | .Op Fl enddate Ar date | ||
319 | .Op Fl extensions Ar section | ||
320 | .Op Fl extfile Ar file | ||
321 | .Op Fl gencrl | ||
322 | .Op Fl in Ar file | ||
323 | .Op Fl infiles | ||
324 | .Op Fl key Ar password | ||
325 | .Op Fl keyfile Ar file | ||
326 | .Op Fl keyform Cm pem | der | ||
327 | .Op Fl md Ar alg | ||
328 | .Op Fl multivalue-rdn | ||
329 | .Op Fl name Ar section | ||
330 | .Op Fl noemailDN | ||
331 | .Op Fl notext | ||
332 | .Op Fl out Ar file | ||
333 | .Op Fl outdir Ar directory | ||
334 | .Op Fl passin Ar arg | ||
335 | .Op Fl policy Ar arg | ||
336 | .Op Fl preserveDN | ||
337 | .Op Fl revoke Ar file | ||
338 | .Op Fl selfsign | ||
339 | .Op Fl sigopt Ar nm:v | ||
340 | .Op Fl ss_cert Ar file | ||
341 | .Op Fl startdate Ar date | ||
342 | .Op Fl status Ar serial | ||
343 | .Op Fl subj Ar arg | ||
344 | .Op Fl updatedb | ||
345 | .Op Fl utf8 | ||
346 | .Op Fl verbose | ||
347 | .Ek | ||
348 | .El | ||
349 | .Pp | ||
350 | The | ||
351 | .Nm ca | ||
352 | command is a minimal certificate authority (CA) application. | ||
353 | It can be used to sign certificate requests in a variety of forms | ||
354 | and generate certificate revocation lists (CRLs). | ||
355 | It also maintains a text database of issued certificates and their status. | ||
356 | .Pp | ||
357 | The options relevant to CAs are as follows: | ||
358 | .Bl -tag -width "XXXX" | ||
359 | .It Fl batch | ||
360 | Batch mode. | ||
361 | In this mode no questions will be asked | ||
362 | and all certificates will be certified automatically. | ||
363 | .It Fl cert Ar file | ||
364 | The CA certificate file. | ||
365 | .It Fl config Ar file | ||
366 | Specify an alternative configuration file. | ||
367 | .It Fl create_serial | ||
368 | If reading the serial from the text file as specified in the | ||
369 | configuration fails, create a new random serial to be used as the | ||
370 | next serial number. | ||
371 | .It Fl days Ar arg | ||
372 | The number of days to certify the certificate for. | ||
373 | .It Fl enddate Ar date | ||
374 | Set the expiry date. | ||
375 | The format of the date is [YY]YYMMDDHHMMSSZ, | ||
376 | with all four year digits required for dates from 2050 onwards. | ||
377 | .It Fl extensions Ar section | ||
378 | The section of the configuration file containing certificate extensions | ||
379 | to be added when a certificate is issued (defaults to | ||
380 | .Cm x509_extensions | ||
381 | unless the | ||
382 | .Fl extfile | ||
383 | option is used). | ||
384 | If no extension section is present, a V1 certificate is created. | ||
385 | If the extension section is present | ||
386 | .Pq even if it is empty , | ||
387 | then a V3 certificate is created. | ||
388 | See the | ||
389 | .Xr x509v3.cnf 5 | ||
390 | manual page for details of the extension section format. | ||
391 | .It Fl extfile Ar file | ||
392 | An additional configuration | ||
393 | .Ar file | ||
394 | to read certificate extensions from | ||
395 | (using the default section unless the | ||
396 | .Fl extensions | ||
397 | option is also used). | ||
398 | .It Fl in Ar file | ||
399 | An input | ||
400 | .Ar file | ||
401 | containing a single certificate request to be signed by the CA. | ||
402 | .It Fl infiles | ||
403 | If present, this should be the last option; all subsequent arguments | ||
404 | are assumed to be the names of files containing certificate requests. | ||
405 | .It Fl key Ar password | ||
406 | The | ||
407 | .Fa password | ||
408 | used to encrypt the private key. | ||
409 | Since on some systems the command line arguments are visible, | ||
410 | this option should be used with caution. | ||
411 | .It Fl keyfile Ar file | ||
412 | The private key to sign requests with. | ||
413 | .It Fl keyform Cm pem | der | ||
414 | Private key file format. | ||
415 | The default is | ||
416 | .Cm pem . | ||
417 | .It Fl md Ar alg | ||
418 | The message digest to use. | ||
419 | Possible values include | ||
420 | .Ar md5 | ||
421 | and | ||
422 | .Ar sha1 . | ||
423 | This option also applies to CRLs. | ||
424 | .It Fl multivalue-rdn | ||
425 | This option causes the | ||
426 | .Fl subj | ||
427 | argument to be interpreted with full support for multivalued RDNs, | ||
428 | for example | ||
429 | .Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" . | ||
430 | If | ||
431 | .Fl multivalue-rdn | ||
432 | is not used, the UID value is set to | ||
433 | .Qq "123456+CN=John Doe" . | ||
434 | .It Fl name Ar section | ||
435 | Specifies the configuration file | ||
436 | .Ar section | ||
437 | to use (overrides | ||
438 | .Cm default_ca | ||
439 | in the | ||
440 | .Cm ca | ||
441 | section). | ||
442 | .It Fl noemailDN | ||
443 | The DN of a certificate can contain the EMAIL field if present in the | ||
444 | request DN, however it is good policy just having the email set into | ||
445 | the | ||
446 | .Cm altName | ||
447 | extension of the certificate. | ||
448 | When this option is set, the EMAIL field is removed from the certificate's | ||
449 | subject and set only in the, eventually present, extensions. | ||
450 | The | ||
451 | .Ar email_in_dn | ||
452 | keyword can be used in the configuration file to enable this behaviour. | ||
453 | .It Fl notext | ||
454 | Don't output the text form of a certificate to the output file. | ||
455 | .It Fl out Ar file | ||
456 | The output file to output certificates to. | ||
457 | The default is standard output. | ||
458 | The certificate details will also be printed out to this file in | ||
459 | PEM format. | ||
460 | .It Fl outdir Ar directory | ||
461 | The | ||
462 | .Ar directory | ||
463 | to output certificates to. | ||
464 | The certificate will be written to a file consisting of the | ||
465 | serial number in hex with | ||
466 | .Qq .pem | ||
467 | appended. | ||
468 | .It Fl passin Ar arg | ||
469 | The key password source. | ||
470 | .It Fl policy Ar arg | ||
471 | Define the CA | ||
472 | .Qq policy | ||
473 | to use. | ||
474 | The policy section in the configuration file | ||
475 | consists of a set of variables corresponding to certificate DN fields. | ||
476 | The values may be one of | ||
477 | .Qq match | ||
478 | (the value must match the same field in the CA certificate), | ||
479 | .Qq supplied | ||
480 | (the value must be present), or | ||
481 | .Qq optional | ||
482 | (the value may be present). | ||
483 | Any fields not mentioned in the policy section | ||
484 | are silently deleted, unless the | ||
485 | .Fl preserveDN | ||
486 | option is set, | ||
487 | but this can be regarded more of a quirk than intended behaviour. | ||
488 | .It Fl preserveDN | ||
489 | Normally, the DN order of a certificate is the same as the order of the | ||
490 | fields in the relevant policy section. | ||
491 | When this option is set, the order is the same as the request. | ||
492 | This is largely for compatibility with the older IE enrollment control | ||
493 | which would only accept certificates if their DNs matched the order of the | ||
494 | request. | ||
495 | This is not needed for Xenroll. | ||
496 | .It Fl selfsign | ||
497 | Indicates the issued certificates are to be signed with the key the | ||
498 | certificate requests were signed with, given with | ||
499 | .Fl keyfile . | ||
500 | Certificate requests signed with a different key are ignored. | ||
501 | If | ||
502 | .Fl gencrl | ||
503 | or | ||
504 | .Fl ss_cert | ||
505 | are given, | ||
506 | .Fl selfsign | ||
507 | is ignored. | ||
508 | .Pp | ||
509 | A consequence of using | ||
510 | .Fl selfsign | ||
511 | is that the self-signed certificate appears among the entries in | ||
512 | the certificate database (see the configuration option | ||
513 | .Cm database ) | ||
514 | and uses the same serial number counter as all other certificates | ||
515 | signed with the self-signed certificate. | ||
516 | .It Fl sigopt Ar nm:v | ||
517 | Pass options to the signature algorithm during sign or certify operations. | ||
518 | The names and values of these options are algorithm-specific. | ||
519 | .It Fl ss_cert Ar file | ||
520 | A single self-signed certificate to be signed by the CA. | ||
521 | .It Fl startdate Ar date | ||
522 | Set the start date. | ||
523 | The format of the date is [YY]YYMMDDHHMMSSZ, | ||
524 | with all four year digits required for dates from 2050 onwards. | ||
525 | .It Fl subj Ar arg | ||
526 | Supersedes the subject name given in the request. | ||
527 | The | ||
528 | .Ar arg | ||
529 | must be formatted as | ||
530 | .Sm off | ||
531 | .Pf / Ar type0 Ns = Ar value0 Ns / Ar type 1 Ns = Ar value 1 Ns / | ||
532 | .Ar type2 Ns = Ar ... ; | ||
533 | .Sm on | ||
534 | characters may be escaped by | ||
535 | .Sq \e | ||
536 | .Pq backslash , | ||
537 | no spaces are skipped. | ||
538 | .It Fl utf8 | ||
539 | Interpret field values read from a terminal or obtained from a | ||
540 | configuration file as UTF-8 strings. | ||
541 | By default, they are interpreted as ASCII. | ||
542 | .It Fl verbose | ||
543 | Print extra details about the operations being performed. | ||
544 | .El | ||
545 | .Pp | ||
546 | The options relevant to CRLs are as follows: | ||
547 | .Bl -tag -width "XXXX" | ||
548 | .It Fl crl_CA_compromise Ar time | ||
549 | This is the same as | ||
550 | .Fl crl_compromise , | ||
551 | except the revocation reason is set to CACompromise. | ||
552 | .It Fl crl_compromise Ar time | ||
553 | Set the revocation reason to keyCompromise and the compromise time to | ||
554 | .Ar time . | ||
555 | .Ar time | ||
556 | should be in GeneralizedTime format, i.e. YYYYMMDDHHMMSSZ. | ||
557 | .It Fl crl_hold Ar instruction | ||
558 | Set the CRL revocation reason code to certificateHold and the hold | ||
559 | instruction to | ||
560 | .Ar instruction | ||
561 | which must be an OID. | ||
562 | Although any OID can be used, only holdInstructionNone | ||
563 | (the use of which is discouraged by RFC 2459), holdInstructionCallIssuer or | ||
564 | holdInstructionReject will normally be used. | ||
565 | .It Fl crl_reason Ar reason | ||
566 | Revocation reason, where | ||
567 | .Ar reason | ||
568 | is one of: | ||
569 | unspecified, keyCompromise, CACompromise, affiliationChanged, superseded, | ||
570 | cessationOfOperation, certificateHold or removeFromCRL. | ||
571 | The matching of | ||
572 | .Ar reason | ||
573 | is case insensitive. | ||
574 | Setting any revocation reason will make the CRL v2. | ||
575 | In practice, removeFromCRL is not particularly useful because it is only used | ||
576 | in delta CRLs which are not currently implemented. | ||
577 | .It Fl crldays Ar days | ||
578 | The number of days before the next CRL is due. | ||
579 | This is the days from now to place in the CRL | ||
580 | .Cm nextUpdate | ||
581 | field. | ||
582 | .It Fl crlexts Ar section | ||
583 | The | ||
584 | .Ar section | ||
585 | of the configuration file containing CRL extensions to include. | ||
586 | If no CRL extension section is present then a V1 CRL is created; | ||
587 | if the CRL extension section is present | ||
588 | (even if it is empty) | ||
589 | then a V2 CRL is created. | ||
590 | The CRL extensions specified are CRL extensions and not CRL entry extensions. | ||
591 | It should be noted that some software can't handle V2 CRLs. | ||
592 | See the | ||
593 | .Xr x509v3.cnf 5 | ||
594 | manual page for details of the extension section format. | ||
595 | .It Fl crlhours Ar hours | ||
596 | The number of hours before the next CRL is due. | ||
597 | .It Fl crlsec Ar seconds | ||
598 | The number of seconds before the next CRL is due. | ||
599 | .It Fl gencrl | ||
600 | Generate a CRL based on information in the index file. | ||
601 | .It Fl revoke Ar file | ||
602 | A | ||
603 | .Ar file | ||
604 | containing a certificate to revoke. | ||
605 | .It Fl status Ar serial | ||
606 | Show the status of the certificate with serial number | ||
607 | .Ar serial . | ||
608 | .It Fl updatedb | ||
609 | Update the database index to purge expired certificates. | ||
610 | .El | ||
611 | .Pp | ||
612 | Many of the options can be set in the | ||
613 | .Cm ca | ||
614 | section of the configuration file | ||
615 | (or in the default section of the configuration file), | ||
616 | specified using | ||
617 | .Cm default_ca | ||
618 | or | ||
619 | .Fl name . | ||
620 | The | ||
621 | .Cm preserve | ||
622 | option is read directly from the | ||
623 | .Cm ca | ||
624 | section. | ||
625 | .Pp | ||
626 | Many of the configuration file options are identical to command line | ||
627 | options. | ||
628 | Where the option is present in the configuration file and the command line, | ||
629 | the command line value is used. | ||
630 | Where an option is described as mandatory, then it must be present in | ||
631 | the configuration file or the command line equivalent | ||
632 | .Pq if any | ||
633 | used. | ||
634 | .Bl -tag -width "XXXX" | ||
635 | .It Cm certificate | ||
636 | The same as | ||
637 | .Fl cert . | ||
638 | It gives the file containing the CA certificate. | ||
639 | Mandatory. | ||
640 | .It Cm copy_extensions | ||
641 | Determines how extensions in certificate requests should be handled. | ||
642 | If set to | ||
643 | .Cm none | ||
644 | or this option is not present, then extensions are | ||
645 | ignored and not copied to the certificate. | ||
646 | If set to | ||
647 | .Cm copy , | ||
648 | then any extensions present in the request that are not already present | ||
649 | are copied to the certificate. | ||
650 | If set to | ||
651 | .Cm copyall , | ||
652 | then all extensions in the request are copied to the certificate: | ||
653 | if the extension is already present in the certificate it is deleted first. | ||
654 | .Pp | ||
655 | The | ||
656 | .Cm copy_extensions | ||
657 | option should be used with caution. | ||
658 | If care is not taken, it can be a security risk. | ||
659 | For example, if a certificate request contains a | ||
660 | .Cm basicConstraints | ||
661 | extension with CA:TRUE and the | ||
662 | .Cm copy_extensions | ||
663 | value is set to | ||
664 | .Cm copyall | ||
665 | and the user does not spot | ||
666 | this when the certificate is displayed, then this will hand the requester | ||
667 | a valid CA certificate. | ||
668 | .Pp | ||
669 | This situation can be avoided by setting | ||
670 | .Cm copy_extensions | ||
671 | to | ||
672 | .Cm copy | ||
673 | and including | ||
674 | .Cm basicConstraints | ||
675 | with CA:FALSE in the configuration file. | ||
676 | Then if the request contains a | ||
677 | .Cm basicConstraints | ||
678 | extension, it will be ignored. | ||
679 | .Pp | ||
680 | The main use of this option is to allow a certificate request to supply | ||
681 | values for certain extensions such as | ||
682 | .Cm subjectAltName . | ||
683 | .It Cm crl_extensions | ||
684 | The same as | ||
685 | .Fl crlexts . | ||
686 | .It Cm crlnumber | ||
687 | A text file containing the next CRL number to use in hex. | ||
688 | The CRL number will be inserted in the CRLs only if this file exists. | ||
689 | If this file is present, it must contain a valid CRL number. | ||
690 | .It Cm database | ||
691 | The text database file to use. | ||
692 | Mandatory. | ||
693 | This file must be present, though initially it will be empty. | ||
694 | .It Cm default_crl_hours , default_crl_days | ||
695 | The same as the | ||
696 | .Fl crlhours | ||
697 | and | ||
698 | .Fl crldays | ||
699 | options. | ||
700 | These will only be used if neither command line option is present. | ||
701 | At least one of these must be present to generate a CRL. | ||
702 | .It Cm default_days | ||
703 | The same as the | ||
704 | .Fl days | ||
705 | option. | ||
706 | The number of days to certify a certificate for. | ||
707 | .It Cm default_enddate | ||
708 | The same as the | ||
709 | .Fl enddate | ||
710 | option. | ||
711 | Either this option or | ||
712 | .Cm default_days | ||
713 | .Pq or the command line equivalents | ||
714 | must be present. | ||
715 | .It Cm default_md | ||
716 | The same as the | ||
717 | .Fl md | ||
718 | option. | ||
719 | The message digest to use. | ||
720 | Mandatory. | ||
721 | .It Cm default_startdate | ||
722 | The same as the | ||
723 | .Fl startdate | ||
724 | option. | ||
725 | The start date to certify a certificate for. | ||
726 | If not set, the current time is used. | ||
727 | .It Cm email_in_dn | ||
728 | The same as | ||
729 | .Fl noemailDN . | ||
730 | If the EMAIL field is to be removed from the DN of the certificate, | ||
731 | simply set this to | ||
732 | .Qq no . | ||
733 | If not present, the default is to allow for the EMAIL field in the | ||
734 | certificate's DN. | ||
735 | .It Cm name_opt , cert_opt | ||
736 | These options allow the format used to display the certificate details | ||
737 | when asking the user to confirm signing. | ||
738 | All the options supported by the | ||
739 | .Nm x509 | ||
740 | utilities' | ||
741 | .Fl nameopt | ||
742 | and | ||
743 | .Fl certopt | ||
744 | switches can be used here, except that | ||
745 | .Cm no_signame | ||
746 | and | ||
747 | .Cm no_sigdump | ||
748 | are permanently set and cannot be disabled | ||
749 | (this is because the certificate signature cannot be displayed because | ||
750 | the certificate has not been signed at this point). | ||
751 | .Pp | ||
752 | For convenience, the value | ||
753 | .Cm ca_default | ||
754 | is accepted by both to produce a reasonable output. | ||
755 | .Pp | ||
756 | If neither option is present, the format used in earlier versions of | ||
757 | .Nm openssl | ||
758 | is used. | ||
759 | Use of the old format is strongly discouraged | ||
760 | because it only displays fields mentioned in the | ||
761 | .Cm policy | ||
762 | section, | ||
763 | mishandles multicharacter string types and does not display extensions. | ||
764 | .It Cm new_certs_dir | ||
765 | The same as the | ||
766 | .Fl outdir | ||
767 | command line option. | ||
768 | It specifies the directory where new certificates will be placed. | ||
769 | Mandatory. | ||
770 | .It Cm oid_file | ||
771 | This specifies a file containing additional object identifiers. | ||
772 | Each line of the file should consist of the numerical form of the | ||
773 | object identifier followed by whitespace, then the short name followed | ||
774 | by whitespace and finally the long name. | ||
775 | .It Cm oid_section | ||
776 | This specifies a section in the configuration file containing extra | ||
777 | object identifiers. | ||
778 | Each line should consist of the short name of the object identifier | ||
779 | followed by | ||
780 | .Sq = | ||
781 | and the numerical form. | ||
782 | The short and long names are the same when this option is used. | ||
783 | .It Cm policy | ||
784 | The same as | ||
785 | .Fl policy . | ||
786 | Mandatory. | ||
787 | .It Cm preserve | ||
788 | The same as | ||
789 | .Fl preserveDN . | ||
790 | .It Cm private_key | ||
791 | Same as the | ||
792 | .Fl keyfile | ||
793 | option. | ||
794 | The file containing the CA private key. | ||
795 | Mandatory. | ||
796 | .It Cm serial | ||
797 | A text file containing the next serial number to use in hex. | ||
798 | Mandatory. | ||
799 | This file must be present and contain a valid serial number. | ||
800 | .It Cm unique_subject | ||
801 | If the value | ||
802 | .Cm yes | ||
803 | is given, the valid certificate entries in the | ||
804 | database must have unique subjects. | ||
805 | If the value | ||
806 | .Cm no | ||
807 | is given, | ||
808 | several valid certificate entries may have the exact same subject. | ||
809 | The default value is | ||
810 | .Cm yes . | ||
811 | .Pp | ||
812 | Note that it is valid in some circumstances for certificates to be created | ||
813 | without any subject. | ||
814 | In cases where there are multiple certificates without | ||
815 | subjects this does not count as a duplicate. | ||
816 | .It Cm x509_extensions | ||
817 | The same as | ||
818 | .Fl extensions . | ||
819 | .El | ||
820 | .Tg certhash | ||
821 | .Sh CERTHASH | ||
822 | .Bl -hang -width "openssl certhash" | ||
823 | .It Nm openssl certhash | ||
824 | .Bk -words | ||
825 | .Op Fl nv | ||
826 | .Ar dir ... | ||
827 | .Ek | ||
828 | .El | ||
829 | .Pp | ||
830 | The | ||
831 | .Nm certhash | ||
832 | command calculates a hash value of | ||
833 | .Qq .pem | ||
834 | file in the specified directory list and creates symbolic links for each file, | ||
835 | where the name of the link is the hash value. | ||
836 | See the | ||
837 | .Xr SSL_CTX_load_verify_locations 3 | ||
838 | manual page for how hash links are used. | ||
839 | .Pp | ||
840 | The links created are of the form | ||
841 | .Qq HHHHHHHH.D , | ||
842 | where each | ||
843 | .Sq H | ||
844 | is a hexadecimal character and | ||
845 | .Sq D | ||
846 | is a single decimal digit. | ||
847 | The hashes for CRLs look similar, except the letter | ||
848 | .Sq r | ||
849 | appears after the period, like this: | ||
850 | .Qq HHHHHHHH.rD . | ||
851 | When processing a directory, | ||
852 | .Nm certhash | ||
853 | will first remove all links that have a name in that syntax and invalid | ||
854 | reference. | ||
855 | .Pp | ||
856 | Multiple objects may have the same hash; they will be indicated by | ||
857 | incrementing the | ||
858 | .Sq D | ||
859 | value. | ||
860 | Duplicates are found by comparing the full SHA256 fingerprint. | ||
861 | A warning will be displayed if a duplicate is found. | ||
862 | .Pp | ||
863 | A warning will also be displayed if there are files that cannot be parsed as | ||
864 | either a certificate or a CRL. | ||
865 | .Pp | ||
866 | The options are as follows: | ||
867 | .Bl -tag -width Ds | ||
868 | .It Fl n | ||
869 | Perform a dry-run, and do not make any changes. | ||
870 | .It Fl v | ||
871 | Print extra details about the processing. | ||
872 | .It Ar dir ... | ||
873 | Specify the directories to process. | ||
874 | .El | ||
875 | .Tg ciphers | ||
876 | .Sh CIPHERS | ||
877 | .Nm openssl ciphers | ||
878 | .Op Fl hsVv | ||
879 | .Op Fl tls1_2 | ||
880 | .Op Fl tls1_3 | ||
881 | .Op Ar control | ||
882 | .Pp | ||
883 | The | ||
884 | .Nm ciphers | ||
885 | command converts the | ||
886 | .Ar control | ||
887 | string from the format documented in | ||
888 | .Xr SSL_CTX_set_cipher_list 3 | ||
889 | into an ordered SSL cipher suite preference list. | ||
890 | If no | ||
891 | .Ar control | ||
892 | string is specified, the | ||
893 | .Cm DEFAULT | ||
894 | list is printed. | ||
895 | .Pp | ||
896 | The options are as follows: | ||
897 | .Bl -tag -width Ds | ||
898 | .It Fl h , \&? | ||
899 | Print a brief usage message. | ||
900 | .It Fl s | ||
901 | Only list ciphers that are supported by the TLS method. | ||
902 | .It Fl tls1_2 | tls1_3 | ||
903 | In combination with the | ||
904 | .Fl s | ||
905 | option, list the ciphers which could be used | ||
906 | if the specified protocol version were negotiated. | ||
907 | .It Fl V | ||
908 | Verbose. | ||
909 | List ciphers with cipher suite code in hex format, | ||
910 | cipher name, and a complete description of protocol version, | ||
911 | key exchange, authentication, encryption, and mac algorithms. | ||
912 | .It Fl v | ||
913 | Like | ||
914 | .Fl V , | ||
915 | but without cipher suite codes. | ||
916 | .El | ||
917 | .Tg cms | ||
918 | .Sh CMS | ||
919 | .Bl -hang -width "openssl cms" | ||
920 | .It Nm openssl cms | ||
921 | .Bk -words | ||
922 | .Oo | ||
923 | .Fl aes128 | aes192 | aes256 | camellia128 | | ||
924 | .Fl camellia192 | camellia256 | des | des3 | | ||
925 | .Fl rc2-40 | rc2-64 | rc2-128 | ||
926 | .Oc | ||
927 | .Op Fl CAfile Ar file | ||
928 | .Op Fl CApath Ar directory | ||
929 | .Op Fl CRLfile Ar file | ||
930 | .Op Fl binary | ||
931 | .Op Fl certfile Ar file | ||
932 | .Op Fl certsout Ar file | ||
933 | .Op Fl cmsout | ||
934 | .Op Fl compress | ||
935 | .Op Fl content Ar file | ||
936 | .Op Fl crlfeol | ||
937 | .Op Fl data_create | ||
938 | .Op Fl data_out | ||
939 | .Op Fl debug_decrypt | ||
940 | .Op Fl decrypt | ||
941 | .Op Fl digest_create | ||
942 | .Op Fl digest_verify | ||
943 | .Op Fl econtent_type Ar type | ||
944 | .Op Fl encrypt | ||
945 | .Op Fl EncryptedData_decrypt | ||
946 | .Op Fl EncryptedData_encrypt | ||
947 | .Op Fl from Ar addr | ||
948 | .Op Fl in Ar file | ||
949 | .Op Fl inform Cm der | pem | smime | ||
950 | .Op Fl inkey Ar file | ||
951 | .Op Fl keyform Cm der | pem | ||
952 | .Op Fl keyid | ||
953 | .Op Fl keyopt Ar nm:v | ||
954 | .Op Fl md Ar digest | ||
955 | .Op Fl no_attr_verify | ||
956 | .Op Fl no_content_verify | ||
957 | .Op Fl no_signer_cert_verify | ||
958 | .Op Fl noattr | ||
959 | .Op Fl nocerts | ||
960 | .Op Fl nodetach | ||
961 | .Op Fl nointern | ||
962 | .Op Fl nooldmime | ||
963 | .Op Fl noout | ||
964 | .Op Fl nosigs | ||
965 | .Op Fl nosmimecap | ||
966 | .Op Fl noverify | ||
967 | .Op Fl out Ar file | ||
968 | .Op Fl outform Cm der | pem | smime | ||
969 | .Op Fl passin Ar src | ||
970 | .Op Fl print | ||
971 | .Op Fl pwri_password Ar arg | ||
972 | .Op Fl rctform Cm der | pem | smime | ||
973 | .Op Fl receipt_request_all | receipt_request_first | ||
974 | .Op Fl receipt_request_from Ar addr | ||
975 | .Op Fl receipt_request_print | ||
976 | .Op Fl receipt_request_to Ar addr | ||
977 | .Op Fl recip Ar file | ||
978 | .Op Fl resign | ||
979 | .Op Fl secretkey Ar key | ||
980 | .Op Fl secretkeyid Ar id | ||
981 | .Op Fl sign | ||
982 | .Op Fl sign_receipt | ||
983 | .Op Fl signer Ar file | ||
984 | .Op Fl stream | indef | noindef | ||
985 | .Op Fl subject Ar s | ||
986 | .Op Fl text | ||
987 | .Op Fl to Ar addr | ||
988 | .Op Fl uncompress | ||
989 | .Op Fl verify | ||
990 | .Op Fl verify_receipt Ar file | ||
991 | .Op Fl verify_retcode | ||
992 | .Op Ar cert.pem ... | ||
993 | .Ek | ||
994 | .El | ||
995 | .Pp | ||
996 | The | ||
997 | .Nm cms | ||
998 | command handles S/MIME v3.1 mail. | ||
999 | It can encrypt, decrypt, sign and verify, compress and uncompress S/MIME | ||
1000 | messages. | ||
1001 | .Pp | ||
1002 | The MIME message must be sent without any blank lines between the headers and | ||
1003 | the output. | ||
1004 | Some mail programs will automatically add a blank line. | ||
1005 | Piping the mail directly to sendmail is one way to achieve the correct format. | ||
1006 | .Pp | ||
1007 | The supplied message to be signed or encrypted must include the necessary MIME | ||
1008 | headers or many S/MIME clients won't display it properly (if at all). | ||
1009 | You can use the | ||
1010 | .Fl text | ||
1011 | option to automatically add plain text headers. | ||
1012 | .Pp | ||
1013 | A "signed and encrypted" message is one where a signed message is then | ||
1014 | encrypted. | ||
1015 | This can be produced by encrypting an already signed message. | ||
1016 | .Pp | ||
1017 | There are various operation options that set the type of operation to be | ||
1018 | performed. | ||
1019 | The meaning of the other options varies according to the operation type. | ||
1020 | .Bl -tag -width "XXXX" | ||
1021 | .It Fl encrypt | ||
1022 | Encrypt mail for the given recipient certificates. | ||
1023 | Input file is the message to be encrypted. | ||
1024 | The output file is the encrypted mail in MIME format. | ||
1025 | The actual CMS type is EnvelopedData. | ||
1026 | Note that no revocation check is done for the recipient cert, so if that | ||
1027 | key has been compromised, others may be able to decrypt the text. | ||
1028 | .It Fl decrypt | ||
1029 | Decrypt mail using the supplied certificate and private key. | ||
1030 | Expects an encrypted mail message in MIME format for the input file. | ||
1031 | The decrypted mail is written to the output file. | ||
1032 | .It Fl sign | ||
1033 | Sign mail using the supplied certificate and private key. | ||
1034 | Input file is the message to be signed. | ||
1035 | The signed message in MIME format is written to the output file. | ||
1036 | .It Fl verify | ||
1037 | Verify signed mail. | ||
1038 | Expects a signed mail message on input and outputs the signed data. | ||
1039 | Both clear text and opaque signing are supported. | ||
1040 | .It Fl cmsout | ||
1041 | Take an input message and write out a PEM encoded CMS structure. | ||
1042 | .It Fl resign | ||
1043 | Resign a message. | ||
1044 | Take an existing message and one or more new signers. | ||
1045 | This operation uses an existing message digest when adding a new signer. | ||
1046 | This means that attributes must be present in at least one existing | ||
1047 | signer using the same message digest or this operation will fail. | ||
1048 | .It Fl data_create | ||
1049 | Create a CMS Data type. | ||
1050 | .It Fl data_out | ||
1051 | Output a content from the input CMS Data type. | ||
1052 | .It Fl digest_create | ||
1053 | Create a CMS DigestedData type. | ||
1054 | .It Fl digest_verify | ||
1055 | Verify a CMS DigestedData type and output the content. | ||
1056 | .It Fl compress | ||
1057 | Create a CMS CompressedData type. | ||
1058 | Must be compiled with zlib support for this option to work. | ||
1059 | .It Fl uncompress | ||
1060 | Uncompress a CMS CompressedData type and output the content. | ||
1061 | Must be compiled with zlib support for this option to work. | ||
1062 | .It Fl EncryptedData_encrypt | ||
1063 | Encrypt a content using supplied symmetric key and algorithm using a | ||
1064 | CMS EncryptedData type. | ||
1065 | .It Fl EncryptedData_decrypt | ||
1066 | Decrypt a CMS EncryptedData type using supplied symmetric key. | ||
1067 | .It Fl sign_receipt | ||
1068 | Generate and output a signed receipt for the supplied message. | ||
1069 | The input message must contain a signed receipt request. | ||
1070 | Functionality is otherwise similar to the | ||
1071 | .Fl sign | ||
1072 | operation. | ||
1073 | .It Xo | ||
1074 | .Fl verify_receipt Ar file | ||
1075 | .Xc | ||
1076 | Verify a signed receipt in file. | ||
1077 | The input message must contain the original receipt request. | ||
1078 | Functionality is otherwise similar to the | ||
1079 | .Fl verify | ||
1080 | operation. | ||
1081 | .El | ||
1082 | .Pp | ||
1083 | The remaining options are as follows: | ||
1084 | .Bl -tag -width "XXXX" | ||
1085 | .It Xo | ||
1086 | .Fl aes128 | aes192 | aes256 | camellia128 | | ||
1087 | .Fl camellia192 | camellia256 | des | des3 | | ||
1088 | .Fl rc2-40 | rc2-64 | rc2-128 | ||
1089 | .Xc | ||
1090 | The encryption algorithm to use. | ||
1091 | 128-, 192-, or 256-bit AES, 128-, 192-, or 256-bit CAMELLIA, | ||
1092 | DES (56 bits), triple DES (168 bits), | ||
1093 | or 40-, 64-, or 128-bit RC2, respectively; | ||
1094 | if not specified, triple DES is | ||
1095 | used. | ||
1096 | Only used with | ||
1097 | .Fl encrypt | ||
1098 | and | ||
1099 | .Fl EncryptedData_encrypt | ||
1100 | commands. | ||
1101 | .It Fl binary | ||
1102 | Normally the input message is converted to "canonical" format which is | ||
1103 | effectively using CR/LF as end of line, as required by the S/MIME specification. | ||
1104 | When this option is present, no translation occurs. | ||
1105 | This is useful when handling binary data which may not be in MIME format. | ||
1106 | .It Fl CAfile Ar file | ||
1107 | A file containing trusted CA certificates, used with | ||
1108 | .Fl verify | ||
1109 | and | ||
1110 | .Fl verify_receipt . | ||
1111 | .It Fl CApath Ar directory | ||
1112 | A directory containing trusted CA certificates, used with | ||
1113 | .Fl verify | ||
1114 | and | ||
1115 | .Fl verify_receipt . | ||
1116 | This directory must be a standard certificate directory: that is a hash | ||
1117 | of each subject name (using | ||
1118 | .Nm x509 Fl hash ) | ||
1119 | should be linked to each certificate. | ||
1120 | .It Fl CRLfile Ar file | ||
1121 | Allows additional certificate revocation lists to be specified for verification. | ||
1122 | The CRLs should be in PEM format. | ||
1123 | .It Ar cert.pem ... | ||
1124 | One or more certificates of message recipients: used when encrypting a message. | ||
1125 | .It Fl certfile Ar file | ||
1126 | Allows additional certificates to be specified. | ||
1127 | When signing, these will be included with the message. | ||
1128 | When verifying, these will be searched for the signer's certificates. | ||
1129 | The certificates should be in PEM format. | ||
1130 | .It Fl certsout Ar file | ||
1131 | A file that any certificates contained in the message are written to. | ||
1132 | .It Xo | ||
1133 | .Fl check_ss_sig , | ||
1134 | .Fl crl_check , | ||
1135 | .Fl crl_check_all , | ||
1136 | .Fl extended_crl , | ||
1137 | .Fl ignore_critical , | ||
1138 | .Fl issuer_checks , | ||
1139 | .Fl policy , | ||
1140 | .Fl policy_check , | ||
1141 | .Fl purpose , | ||
1142 | .Fl x509_strict | ||
1143 | .Xc | ||
1144 | Set various certificate chain validation options. | ||
1145 | See the | ||
1146 | .Nm verify | ||
1147 | command for details. | ||
1148 | .It Fl content Ar file | ||
1149 | A file containing the detached content. | ||
1150 | This is only useful with the | ||
1151 | .Fl verify | ||
1152 | command. | ||
1153 | This is only usable if the CMS structure is using the detached signature | ||
1154 | form where the content is not included. | ||
1155 | This option will override any content if the input format is S/MIME and | ||
1156 | it uses the multipart/signed MIME content type. | ||
1157 | .It Fl crlfeol | ||
1158 | Output a S/MIME message with CR/LF end of line. | ||
1159 | .It Fl debug_decrypt | ||
1160 | Set the CMS_DEBUG_DECRYPT flag when decrypting. | ||
1161 | This option should be used with caution, since this can be used to disable | ||
1162 | the MMA attack protection and return an error if no recipient can be found. | ||
1163 | See the | ||
1164 | .Xr CMS_decrypt 3 | ||
1165 | manual page for details of the flag. | ||
1166 | .It Xo | ||
1167 | .Fl from Ar addr , | ||
1168 | .Fl subject Ar s , | ||
1169 | .Fl to Ar addr | ||
1170 | .Xc | ||
1171 | The relevant mail headers. | ||
1172 | These are included outside the signed portion of a message so they may | ||
1173 | be included manually. | ||
1174 | If signing then many S/MIME mail clients check the signer's certificate's | ||
1175 | email address matches that specified in the From: address. | ||
1176 | .It Fl econtent_type Ar type | ||
1177 | Set the encapsulated content type, used with | ||
1178 | .Fl sign . | ||
1179 | If not supplied, the Data type is used. | ||
1180 | The type argument can be any valid OID name in either text or numerical format. | ||
1181 | .It Fl in Ar file | ||
1182 | The input message to be encrypted or signed or the message to be decrypted or | ||
1183 | verified. | ||
1184 | .It Fl inform Cm der | pem | smime | ||
1185 | The input format for the CMS structure. | ||
1186 | The default is | ||
1187 | .Cm smime , | ||
1188 | which reads an S/MIME format message. | ||
1189 | .Cm pem | ||
1190 | and | ||
1191 | .Cm der | ||
1192 | format change this to expect PEM and DER format CMS structures instead. | ||
1193 | This currently only affects the input format of the CMS structure; if no | ||
1194 | CMS structure is being input (for example with | ||
1195 | .Fl encrypt | ||
1196 | or | ||
1197 | .Fl sign ) | ||
1198 | this option has no effect. | ||
1199 | .It Fl inkey Ar file | ||
1200 | The private key to use when signing or decrypting. | ||
1201 | This must match the corresponding certificate. | ||
1202 | If this option is not specified then the private key must be included in | ||
1203 | the certificate file specified with the | ||
1204 | .Fl recip | ||
1205 | or | ||
1206 | .Fl signer | ||
1207 | file. | ||
1208 | When signing, this option can be used multiple times to specify successive keys. | ||
1209 | .It Fl keyform Cm der | pem | ||
1210 | Input private key format. | ||
1211 | The default is | ||
1212 | .Cm pem . | ||
1213 | .It Fl keyid | ||
1214 | Use subject key identifier to identify certificates instead of issuer | ||
1215 | name and serial number. | ||
1216 | The supplied certificate must include a subject key identifier extension. | ||
1217 | Supported by | ||
1218 | .Fl sign | ||
1219 | and | ||
1220 | .Fl encrypt | ||
1221 | operations. | ||
1222 | .It Fl keyopt Ar nm:v | ||
1223 | Set customised parameters for the preceding key or certificate | ||
1224 | for encryption and signing. | ||
1225 | It can currently be used to set RSA-PSS for signing, RSA-OAEP for | ||
1226 | encryption or to modify default parameters for ECDH. | ||
1227 | This option can be used multiple times. | ||
1228 | .It Fl md Ar digest | ||
1229 | The digest algorithm to use when signing or resigning. | ||
1230 | If not present then the default digest algorithm for the signing key | ||
1231 | will be used (usually SHA1). | ||
1232 | .It Fl no_attr_verify | ||
1233 | Do not verify the signer's attribute of a signature. | ||
1234 | .It Fl no_content_verify | ||
1235 | Do not verify the content of a signed message. | ||
1236 | .It Fl no_signer_cert_verify | ||
1237 | Do not verify the signer's certificate of a signed message. | ||
1238 | .It Fl noattr | ||
1239 | Do not include attributes. | ||
1240 | Normally when a message is signed a set of attributes are included which | ||
1241 | include the signing time and supported symmetric algorithms. | ||
1242 | With this option they are not included. | ||
1243 | .It Fl nocerts | ||
1244 | Do not include the signer's certificate. | ||
1245 | This will reduce the size of the signed message but the verifier must | ||
1246 | have a copy of the signer's certificate available locally (passed using | ||
1247 | the | ||
1248 | .Fl certfile | ||
1249 | option for example). | ||
1250 | .It Fl nodetach | ||
1251 | When signing a message, use opaque signing. | ||
1252 | This form is more resistant to translation by mail relays but it cannot be | ||
1253 | read by mail agents that do not support S/MIME. | ||
1254 | Without this option cleartext signing with the MIME type multipart/signed is | ||
1255 | used. | ||
1256 | .It Fl nointern | ||
1257 | Only the certificates specified in the | ||
1258 | .Fl certfile | ||
1259 | option are used. | ||
1260 | When verifying a message, normally certificates (if any) included in the | ||
1261 | message are searched for the signing certificate. | ||
1262 | The supplied certificates can still be used as untrusted CAs however. | ||
1263 | .It Fl nooldmime | ||
1264 | Output an old S/MIME content type like "application/x-pkcs7-". | ||
1265 | .It Fl noout | ||
1266 | Do not output the parsed CMS structure for the | ||
1267 | .Fl cmsout | ||
1268 | operation. | ||
1269 | This is useful when combined with the | ||
1270 | .Fl print | ||
1271 | option or if the syntax of the CMS structure is being checked. | ||
1272 | .It Fl nosigs | ||
1273 | Do not try to verify the signatures on the message. | ||
1274 | .It Fl nosmimecap | ||
1275 | Exclude the list of supported algorithms from signed attributes; other | ||
1276 | options such as signing time and content type are still included. | ||
1277 | .It Fl noverify | ||
1278 | Do not verify the signer's certificate of a signed message. | ||
1279 | .It Fl out Ar file | ||
1280 | The message text that has been decrypted or verified or the output MIME | ||
1281 | format message that has been signed or verified. | ||
1282 | .It Fl outform Cm der | pem | smime | ||
1283 | This specifies the output format for the CMS structure. | ||
1284 | The default is | ||
1285 | .Cm smime , | ||
1286 | which writes an S/MIME format message. | ||
1287 | .Cm pem | ||
1288 | and | ||
1289 | .Cm der | ||
1290 | format change this to write PEM and DER format CMS structures instead. | ||
1291 | This currently only affects the output format of the CMS structure; if | ||
1292 | no CMS structure is being output (for example with | ||
1293 | .Fl verify | ||
1294 | or | ||
1295 | .Fl decrypt ) | ||
1296 | this option has no effect. | ||
1297 | .It Fl passin Ar src | ||
1298 | The private key password source. | ||
1299 | .It Fl print | ||
1300 | Print out all fields of the CMS structure for the | ||
1301 | .Fl cmsout | ||
1302 | operation. | ||
1303 | This is mainly useful for testing purposes. | ||
1304 | .It Fl pwri_password Ar arg | ||
1305 | Specify PasswordRecipientInfo (PWRI) password to use. | ||
1306 | Supported by the | ||
1307 | .Fl encrypt | ||
1308 | and | ||
1309 | .Fl decrypt | ||
1310 | operations. | ||
1311 | .It Fl rctform Cm der | pem | smime | ||
1312 | Specify the format for a signed receipt for use with the | ||
1313 | .Fl receipt_verify | ||
1314 | operation. | ||
1315 | The default is | ||
1316 | .Cm smime . | ||
1317 | .It Fl receipt_request_all | receipt_request_first | ||
1318 | Indicate requests should be provided by all recipient or first tier | ||
1319 | recipients (those mailed directly and not from a mailing list), for the | ||
1320 | .Fl sign | ||
1321 | operation to include a signed receipt request. | ||
1322 | Ignored if | ||
1323 | .Fl receipt_request_from | ||
1324 | is included. | ||
1325 | .It Fl receipt_request_from Ar addr | ||
1326 | Add an explicit email address where receipts should be supplied. | ||
1327 | .It Fl receipt_request_print | ||
1328 | Print out the contents of any signed receipt requests for the | ||
1329 | .Fl verify | ||
1330 | operation. | ||
1331 | .It Fl receipt_request_to Ar addr | ||
1332 | Add an explicit email address where signed receipts should be sent to. | ||
1333 | This option must be supplied if a signed receipt is requested. | ||
1334 | .It Fl recip Ar file | ||
1335 | When decrypting a message, this specifies the recipient's certificate. | ||
1336 | The certificate must match one of the recipients of the message or an | ||
1337 | error occurs. | ||
1338 | When encrypting a message, this option may be used multiple times to | ||
1339 | specify each recipient. | ||
1340 | This form must be used if customised parameters are required (for example to | ||
1341 | specify RSA-OAEP). | ||
1342 | Only certificates carrying RSA, Diffie-Hellman or EC keys are supported | ||
1343 | by this option. | ||
1344 | .It Fl secretkey Ar key | ||
1345 | Specify symmetric key to use. | ||
1346 | The key must be supplied in hex format and be consistent with the | ||
1347 | algorithm used. | ||
1348 | Supported by the | ||
1349 | .Fl EncryptedData_encrypt , | ||
1350 | .Fl EncryptedData_decrypt , | ||
1351 | .Fl encrypt | ||
1352 | and | ||
1353 | .Fl decrypt | ||
1354 | operations. | ||
1355 | When used with | ||
1356 | .Fl encrypt | ||
1357 | or | ||
1358 | .Fl decrypt , | ||
1359 | the supplied key is used to wrap or unwrap the content encryption key | ||
1360 | using an AES key in the KEKRecipientInfo type. | ||
1361 | .It Fl secretkeyid Ar id | ||
1362 | The key identifier for the supplied symmetric key for KEKRecipientInfo type. | ||
1363 | This option must be present if the | ||
1364 | .Fl secretkey | ||
1365 | option is used with | ||
1366 | .Fl encrypt . | ||
1367 | With | ||
1368 | .Fl decrypt | ||
1369 | operations the id is used to locate the relevant key; if it is not supplied | ||
1370 | then an attempt is used to decrypt any KEKRecipientInfo structures. | ||
1371 | .It Fl signer Ar file | ||
1372 | A signing certificate when signing or resigning a message; this option | ||
1373 | can be used multiple times if more than one signer is required. | ||
1374 | If a message is being verified then the signers certificates will be | ||
1375 | written to this file if the verification was successful. | ||
1376 | .It Xo | ||
1377 | .Fl stream | | ||
1378 | .Fl indef | | ||
1379 | .Fl noindef | ||
1380 | .Xc | ||
1381 | The | ||
1382 | .Fl stream | ||
1383 | and | ||
1384 | .Fl indef | ||
1385 | options are equivalent and enable streaming I/O for encoding operations. | ||
1386 | This permits single pass processing of data without the need to hold the | ||
1387 | entire contents in memory, potentially supporting very large files. | ||
1388 | Streaming is automatically set for S/MIME signing with detached data if | ||
1389 | the output format is | ||
1390 | .Cm smime ; | ||
1391 | it is currently off by default for all other operations. | ||
1392 | .Fl noindef | ||
1393 | disable streaming I/O where it would produce an indefinite length | ||
1394 | constructed encoding. | ||
1395 | This option currently has no effect. | ||
1396 | .It Fl text | ||
1397 | Add plain text (text/plain) MIME headers to the supplied message if | ||
1398 | encrypting or signing. | ||
1399 | If decrypting or verifying, it strips off text headers: if the decrypted | ||
1400 | or verified message is not of MIME type text/plain then an error occurs. | ||
1401 | .It Fl verify_retcode | ||
1402 | Set verification error code to exit code to indicate what verification error | ||
1403 | has occurred. | ||
1404 | Supported by | ||
1405 | .Fl verify | ||
1406 | operation only. | ||
1407 | Exit code value minus 32 shows verification error code. | ||
1408 | See | ||
1409 | .Nm verify | ||
1410 | command for the list of verification error code. | ||
1411 | .El | ||
1412 | .Pp | ||
1413 | The exit codes for | ||
1414 | .Nm cms | ||
1415 | are as follows: | ||
1416 | .Pp | ||
1417 | .Bl -tag -width "XXXX" -offset 3n -compact | ||
1418 | .It 0 | ||
1419 | The operation was completely successful. | ||
1420 | .It 1 | ||
1421 | An error occurred parsing the command options. | ||
1422 | .It 2 | ||
1423 | One of the input files could not be read. | ||
1424 | .It 3 | ||
1425 | An error occurred creating the CMS file or when reading the MIME message. | ||
1426 | .It 4 | ||
1427 | An error occurred decrypting or verifying the message. | ||
1428 | .It 5 | ||
1429 | The message was verified correctly but an error occurred writing out the | ||
1430 | signer's certificates. | ||
1431 | .It 6 | ||
1432 | An error occurred writing the output file. | ||
1433 | .It 32+ | ||
1434 | A verify error occurred while | ||
1435 | .Fl verify_retcode | ||
1436 | is specified. | ||
1437 | .El | ||
1438 | .Tg crl | ||
1439 | .Sh CRL | ||
1440 | .Bl -hang -width "openssl crl" | ||
1441 | .It Nm openssl crl | ||
1442 | .Bk -words | ||
1443 | .Op Fl CAfile Ar file | ||
1444 | .Op Fl CApath Ar dir | ||
1445 | .Op Fl crlnumber | ||
1446 | .Op Fl fingerprint | ||
1447 | .Op Fl hash | ||
1448 | .Op Fl hash_old | ||
1449 | .Op Fl in Ar file | ||
1450 | .Op Fl inform Cm der | pem | ||
1451 | .Op Fl issuer | ||
1452 | .Op Fl lastupdate | ||
1453 | .Op Fl nameopt Ar option | ||
1454 | .Op Fl nextupdate | ||
1455 | .Op Fl noout | ||
1456 | .Op Fl out Ar file | ||
1457 | .Op Fl outform Cm der | pem | ||
1458 | .Op Fl text | ||
1459 | .Op Fl verify | ||
1460 | .Ek | ||
1461 | .El | ||
1462 | .Pp | ||
1463 | The | ||
1464 | .Nm crl | ||
1465 | command processes CRL files in DER or PEM format. | ||
1466 | .Pp | ||
1467 | The options are as follows: | ||
1468 | .Bl -tag -width Ds | ||
1469 | .It Fl CAfile Ar file | ||
1470 | Verify the signature on a CRL by looking up the issuing certificate in | ||
1471 | .Ar file . | ||
1472 | .It Fl CApath Ar directory | ||
1473 | Verify the signature on a CRL by looking up the issuing certificate in | ||
1474 | .Ar dir . | ||
1475 | This directory must be a standard certificate directory, | ||
1476 | i.e. a hash of each subject name (using | ||
1477 | .Cm x509 Fl hash ) | ||
1478 | should be linked to each certificate. | ||
1479 | .It Fl crlnumber | ||
1480 | Print the CRL number. | ||
1481 | .It Fl fingerprint | ||
1482 | Print the CRL fingerprint. | ||
1483 | .It Fl hash | ||
1484 | Output a hash of the issuer name. | ||
1485 | This can be used to look up CRLs in a directory by issuer name. | ||
1486 | .It Fl hash_old | ||
1487 | Output an old-style (MD5) hash of the issuer name. | ||
1488 | .It Fl in Ar file | ||
1489 | The input file to read from, or standard input if not specified. | ||
1490 | .It Fl inform Cm der | pem | ||
1491 | The input format. | ||
1492 | .It Fl issuer | ||
1493 | Output the issuer name. | ||
1494 | .It Fl lastupdate | ||
1495 | Output the | ||
1496 | .Cm thisUpdate | ||
1497 | field. | ||
1498 | This option is misnamed for historical reasons. | ||
1499 | .It Fl nameopt Ar option | ||
1500 | Specify certificate name options. | ||
1501 | .It Fl nextupdate | ||
1502 | Output the | ||
1503 | .Cm nextUpdate | ||
1504 | field. | ||
1505 | .It Fl noout | ||
1506 | Do not output the encoded version of the CRL. | ||
1507 | .It Fl out Ar file | ||
1508 | The output file to write to, or standard output if not specified. | ||
1509 | .It Fl outform Cm der | pem | ||
1510 | The output format. | ||
1511 | .It Fl text | ||
1512 | Print the CRL in plain text. | ||
1513 | .It Fl verify | ||
1514 | Verify the signature on the CRL. | ||
1515 | .El | ||
1516 | .Tg crl2pkcs7 | ||
1517 | .Sh CRL2PKCS7 | ||
1518 | .Bl -hang -width "openssl crl2pkcs7" | ||
1519 | .It Nm openssl crl2pkcs7 | ||
1520 | .Bk -words | ||
1521 | .Op Fl certfile Ar file | ||
1522 | .Op Fl in Ar file | ||
1523 | .Op Fl inform Cm der | pem | ||
1524 | .Op Fl nocrl | ||
1525 | .Op Fl out Ar file | ||
1526 | .Op Fl outform Cm der | pem | ||
1527 | .Ek | ||
1528 | .El | ||
1529 | .Pp | ||
1530 | The | ||
1531 | .Nm crl2pkcs7 | ||
1532 | command takes an optional CRL and one or more | ||
1533 | certificates and converts them into a PKCS#7 degenerate | ||
1534 | .Qq certificates only | ||
1535 | structure. | ||
1536 | .Pp | ||
1537 | The options are as follows: | ||
1538 | .Bl -tag -width Ds | ||
1539 | .It Fl certfile Ar file | ||
1540 | Add the certificates in PEM | ||
1541 | .Ar file | ||
1542 | to the PKCS#7 structure. | ||
1543 | This option can be used more than once | ||
1544 | to read certificates from multiple files. | ||
1545 | .It Fl in Ar file | ||
1546 | Read the CRL from | ||
1547 | .Ar file , | ||
1548 | or standard input if not specified. | ||
1549 | .It Fl inform Cm der | pem | ||
1550 | The input format. | ||
1551 | .It Fl nocrl | ||
1552 | Normally, a CRL is included in the output file. | ||
1553 | With this option, no CRL is | ||
1554 | included in the output file and a CRL is not read from the input file. | ||
1555 | .It Fl out Ar file | ||
1556 | Write the PKCS#7 structure to | ||
1557 | .Ar file , | ||
1558 | or standard output if not specified. | ||
1559 | .It Fl outform Cm der | pem | ||
1560 | The output format. | ||
1561 | .El | ||
1562 | .Tg dgst | ||
1563 | .Sh DGST | ||
1564 | .Bl -hang -width "openssl dgst" | ||
1565 | .It Nm openssl dgst | ||
1566 | .Bk -words | ||
1567 | .Op Fl cdr | ||
1568 | .Op Fl binary | ||
1569 | .Op Fl Ar digest | ||
1570 | .Op Fl hex | ||
1571 | .Op Fl hmac Ar key | ||
1572 | .Op Fl keyform Cm pem | ||
1573 | .Op Fl mac Ar algorithm | ||
1574 | .Op Fl macopt Ar nm : Ns Ar v | ||
1575 | .Op Fl out Ar file | ||
1576 | .Op Fl passin Ar arg | ||
1577 | .Op Fl prverify Ar file | ||
1578 | .Op Fl sign Ar file | ||
1579 | .Op Fl signature Ar file | ||
1580 | .Op Fl sigopt Ar nm : Ns Ar v | ||
1581 | .Op Fl verify Ar file | ||
1582 | .Op Ar | ||
1583 | .Ek | ||
1584 | .El | ||
1585 | .Pp | ||
1586 | The digest functions output the message digest of a supplied | ||
1587 | .Ar file | ||
1588 | or | ||
1589 | .Ar files | ||
1590 | in hexadecimal form. | ||
1591 | They can also be used for digital signing and verification. | ||
1592 | .Pp | ||
1593 | The options are as follows: | ||
1594 | .Bl -tag -width Ds | ||
1595 | .It Fl binary | ||
1596 | Output the digest or signature in binary form. | ||
1597 | .It Fl c | ||
1598 | Print the digest in two-digit groups separated by colons. | ||
1599 | .It Fl d | ||
1600 | Print BIO debugging information. | ||
1601 | .It Fl Ar digest | ||
1602 | Use the specified message | ||
1603 | .Ar digest . | ||
1604 | The default is SHA256. | ||
1605 | The available digests can be displayed using | ||
1606 | .Nm openssl | ||
1607 | .Cm list-message-digest-commands . | ||
1608 | The following are equivalent: | ||
1609 | .Nm openssl dgst | ||
1610 | .Fl sha256 | ||
1611 | and | ||
1612 | .Nm openssl | ||
1613 | .Cm sha256 . | ||
1614 | .It Fl hex | ||
1615 | Digest is to be output as a hex dump. | ||
1616 | This is the default case for a | ||
1617 | .Qq normal | ||
1618 | digest as opposed to a digital signature. | ||
1619 | .It Fl hmac Ar key | ||
1620 | Create a hashed MAC using | ||
1621 | .Ar key . | ||
1622 | .It Fl keyform Cm pem | ||
1623 | Specifies the key format to sign the digest with. | ||
1624 | .It Fl mac Ar algorithm | ||
1625 | Create a keyed Message Authentication Code (MAC). | ||
1626 | The most popular MAC algorithm is HMAC (hash-based MAC), | ||
1627 | but there are other MAC algorithms which are not based on hash. | ||
1628 | MAC keys and other options should be set via the | ||
1629 | .Fl macopt | ||
1630 | parameter. | ||
1631 | .It Fl macopt Ar nm : Ns Ar v | ||
1632 | Passes options to the MAC algorithm, specified by | ||
1633 | .Fl mac . | ||
1634 | The following options are supported by HMAC: | ||
1635 | .Bl -tag -width Ds | ||
1636 | .It Cm key : Ns Ar string | ||
1637 | Specifies the MAC key as an alphanumeric string | ||
1638 | (use if the key contain printable characters only). | ||
1639 | String length must conform to any restrictions of the MAC algorithm. | ||
1640 | .It Cm hexkey : Ns Ar string | ||
1641 | Specifies the MAC key in hexadecimal form (two hex digits per byte). | ||
1642 | Key length must conform to any restrictions of the MAC algorithm. | ||
1643 | .El | ||
1644 | .It Fl out Ar file | ||
1645 | The output file to write to, | ||
1646 | or standard output if not specified. | ||
1647 | .It Fl passin Ar arg | ||
1648 | The key password source. | ||
1649 | .It Fl prverify Ar file | ||
1650 | Verify the signature using the private key in | ||
1651 | .Ar file . | ||
1652 | The output is either | ||
1653 | .Qq Verification OK | ||
1654 | or | ||
1655 | .Qq Verification Failure . | ||
1656 | .It Fl r | ||
1657 | Print the digest in coreutils format. | ||
1658 | .It Fl sign Ar file | ||
1659 | Digitally sign the digest using the private key in | ||
1660 | .Ar file . | ||
1661 | .It Fl signature Ar file | ||
1662 | The actual signature to verify. | ||
1663 | .It Fl sigopt Ar nm : Ns Ar v | ||
1664 | Pass options to the signature algorithm during sign or verify operations. | ||
1665 | The names and values of these options are algorithm-specific. | ||
1666 | .It Fl verify Ar file | ||
1667 | Verify the signature using the public key in | ||
1668 | .Ar file . | ||
1669 | The output is either | ||
1670 | .Qq Verification OK | ||
1671 | or | ||
1672 | .Qq Verification Failure . | ||
1673 | .It Ar | ||
1674 | File or files to digest. | ||
1675 | If no files are specified then standard input is used. | ||
1676 | .El | ||
1677 | .Tg dhparam | ||
1678 | .Sh DHPARAM | ||
1679 | .Bl -hang -width "openssl dhparam" | ||
1680 | .It Nm openssl dhparam | ||
1681 | .Bk -words | ||
1682 | .Op Fl 2 | 5 | ||
1683 | .Op Fl check | ||
1684 | .Op Fl dsaparam | ||
1685 | .Op Fl in Ar file | ||
1686 | .Op Fl inform Cm der | pem | ||
1687 | .Op Fl noout | ||
1688 | .Op Fl out Ar file | ||
1689 | .Op Fl outform Cm der | pem | ||
1690 | .Op Fl text | ||
1691 | .Op Ar numbits | ||
1692 | .Ek | ||
1693 | .El | ||
1694 | .Pp | ||
1695 | The | ||
1696 | .Nm dhparam | ||
1697 | command is used to manipulate DH parameter files. | ||
1698 | Only the older PKCS#3 DH is supported, | ||
1699 | not the newer X9.42 DH. | ||
1700 | .Pp | ||
1701 | The options are as follows: | ||
1702 | .Bl -tag -width Ds | ||
1703 | .It Fl 2 , 5 | ||
1704 | The generator to use; | ||
1705 | 2 is the default. | ||
1706 | If present, the input file is ignored and parameters are generated instead. | ||
1707 | .It Fl check | ||
1708 | Check the DH parameters. | ||
1709 | .It Fl dsaparam | ||
1710 | Read or create DSA parameters, | ||
1711 | converted to DH format on output. | ||
1712 | Otherwise, | ||
1713 | .Qq strong | ||
1714 | primes | ||
1715 | .Pq such that (p-1)/2 is also prime | ||
1716 | will be used for DH parameter generation. | ||
1717 | .Pp | ||
1718 | DH parameter generation with the | ||
1719 | .Fl dsaparam | ||
1720 | option is much faster, | ||
1721 | and the recommended exponent length is shorter, | ||
1722 | which makes DH key exchange more efficient. | ||
1723 | Beware that with such DSA-style DH parameters, | ||
1724 | a fresh DH key should be created for each use to | ||
1725 | avoid small-subgroup attacks that may be possible otherwise. | ||
1726 | .It Fl in Ar file | ||
1727 | The input file to read from, | ||
1728 | or standard input if not specified. | ||
1729 | .It Fl inform Cm der | pem | ||
1730 | The input format. | ||
1731 | .It Fl noout | ||
1732 | Do not output the encoded version of the parameters. | ||
1733 | .It Fl out Ar file | ||
1734 | The output file to write to, | ||
1735 | or standard output if not specified. | ||
1736 | .It Fl outform Cm der | pem | ||
1737 | The output format. | ||
1738 | .It Fl text | ||
1739 | Print the DH parameters in plain text. | ||
1740 | .It Ar numbits | ||
1741 | Generate a parameter set of size | ||
1742 | .Ar numbits . | ||
1743 | It must be the last option. | ||
1744 | If not present, a value of 2048 is used. | ||
1745 | If this value is present, the input file is ignored and | ||
1746 | parameters are generated instead. | ||
1747 | .El | ||
1748 | .Tg dsa | ||
1749 | .Sh DSA | ||
1750 | .Bl -hang -width "openssl dsa" | ||
1751 | .It Nm openssl dsa | ||
1752 | .Bk -words | ||
1753 | .Oo | ||
1754 | .Fl aes128 | aes192 | aes256 | | ||
1755 | .Fl des | des3 | ||
1756 | .Oc | ||
1757 | .Op Fl in Ar file | ||
1758 | .Op Fl inform Cm der | pem | pvk | ||
1759 | .Op Fl modulus | ||
1760 | .Op Fl noout | ||
1761 | .Op Fl out Ar file | ||
1762 | .Op Fl outform Cm der | pem | pvk | ||
1763 | .Op Fl passin Ar arg | ||
1764 | .Op Fl passout Ar arg | ||
1765 | .Op Fl pubin | ||
1766 | .Op Fl pubout | ||
1767 | .Op Fl pvk-none | pvk-strong | pvk-weak | ||
1768 | .Op Fl text | ||
1769 | .Ek | ||
1770 | .El | ||
1771 | .Pp | ||
1772 | The | ||
1773 | .Nm dsa | ||
1774 | command processes DSA keys. | ||
1775 | They can be converted between various forms and their components printed out. | ||
1776 | .Pp | ||
1777 | .Sy Note : | ||
1778 | This command uses the traditional | ||
1779 | .Nm SSLeay | ||
1780 | compatible format for private key encryption: | ||
1781 | newer applications should use the more secure PKCS#8 format using the | ||
1782 | .Nm pkcs8 | ||
1783 | command. | ||
1784 | .Pp | ||
1785 | The options are as follows: | ||
1786 | .Bl -tag -width Ds | ||
1787 | .It Xo | ||
1788 | .Fl aes128 | aes192 | aes256 | | ||
1789 | .Fl des | des3 | ||
1790 | .Xc | ||
1791 | Encrypt the private key with the AES, DES, or the triple DES | ||
1792 | ciphers, respectively, before outputting it. | ||
1793 | A pass phrase is prompted for. | ||
1794 | If none of these options are specified, the key is written in plain text. | ||
1795 | This means that using the | ||
1796 | .Nm dsa | ||
1797 | utility to read an encrypted key with no encryption option can be used to | ||
1798 | remove the pass phrase from a key, | ||
1799 | or by setting the encryption options it can be used to add or change | ||
1800 | the pass phrase. | ||
1801 | These options can only be used with PEM format output files. | ||
1802 | .It Fl in Ar file | ||
1803 | The input file to read from, | ||
1804 | or standard input if not specified. | ||
1805 | If the key is encrypted, a pass phrase will be prompted for. | ||
1806 | .It Fl inform Cm der | pem | pvk | ||
1807 | The input format. | ||
1808 | .It Fl modulus | ||
1809 | Print the value of the public key component of the key. | ||
1810 | .It Fl noout | ||
1811 | Do not output the encoded version of the key. | ||
1812 | .It Fl out Ar file | ||
1813 | The output file to write to, | ||
1814 | or standard output if not specified. | ||
1815 | If any encryption options are set then a pass phrase will be | ||
1816 | prompted for. | ||
1817 | .It Fl outform Cm der | pem | pvk | ||
1818 | The output format. | ||
1819 | .It Fl passin Ar arg | ||
1820 | The key password source. | ||
1821 | .It Fl passout Ar arg | ||
1822 | The output file password source. | ||
1823 | .It Fl pubin | ||
1824 | Read in a public key, not a private key. | ||
1825 | .It Fl pubout | ||
1826 | Output a public key, not a private key. | ||
1827 | Automatically set if the input is a public key. | ||
1828 | .It Xo | ||
1829 | .Fl pvk-none | pvk-strong | pvk-weak | ||
1830 | .Xc | ||
1831 | Enable or disable PVK encoding. | ||
1832 | The default is | ||
1833 | .Fl pvk-strong . | ||
1834 | .It Fl text | ||
1835 | Print the public/private key in plain text. | ||
1836 | .El | ||
1837 | .Tg dsaparam | ||
1838 | .Sh DSAPARAM | ||
1839 | .Bl -hang -width "openssl dsaparam" | ||
1840 | .It Nm openssl dsaparam | ||
1841 | .Bk -words | ||
1842 | .Op Fl genkey | ||
1843 | .Op Fl in Ar file | ||
1844 | .Op Fl inform Cm der | pem | ||
1845 | .Op Fl noout | ||
1846 | .Op Fl out Ar file | ||
1847 | .Op Fl outform Cm der | pem | ||
1848 | .Op Fl text | ||
1849 | .Op Ar numbits | ||
1850 | .Ek | ||
1851 | .El | ||
1852 | .Pp | ||
1853 | The | ||
1854 | .Nm dsaparam | ||
1855 | command is used to manipulate or generate DSA parameter files. | ||
1856 | .Pp | ||
1857 | The options are as follows: | ||
1858 | .Bl -tag -width Ds | ||
1859 | .It Fl genkey | ||
1860 | Generate a DSA key either using the specified or generated | ||
1861 | parameters. | ||
1862 | .It Fl in Ar file | ||
1863 | The input file to read from, | ||
1864 | or standard input if not specified. | ||
1865 | If the | ||
1866 | .Ar numbits | ||
1867 | parameter is included, then this option is ignored. | ||
1868 | .It Fl inform Cm der | pem | ||
1869 | The input format. | ||
1870 | .It Fl noout | ||
1871 | Do not output the encoded version of the parameters. | ||
1872 | .It Fl out Ar file | ||
1873 | The output file to write to, | ||
1874 | or standard output if not specified. | ||
1875 | .It Fl outform Cm der | pem | ||
1876 | The output format. | ||
1877 | .It Fl text | ||
1878 | Print the DSA parameters in plain text. | ||
1879 | .It Ar numbits | ||
1880 | Generate a parameter set of size | ||
1881 | .Ar numbits . | ||
1882 | If this option is included, the input file is ignored. | ||
1883 | .El | ||
1884 | .Tg ec | ||
1885 | .Sh EC | ||
1886 | .Bl -hang -width "openssl ec" | ||
1887 | .It Nm openssl ec | ||
1888 | .Bk -words | ||
1889 | .Op Fl conv_form Ar arg | ||
1890 | .Op Fl des | ||
1891 | .Op Fl des3 | ||
1892 | .Op Fl in Ar file | ||
1893 | .Op Fl inform Cm der | pem | ||
1894 | .Op Fl noout | ||
1895 | .Op Fl out Ar file | ||
1896 | .Op Fl outform Cm der | pem | ||
1897 | .Op Fl param_enc Ar arg | ||
1898 | .Op Fl param_out | ||
1899 | .Op Fl passin Ar arg | ||
1900 | .Op Fl passout Ar arg | ||
1901 | .Op Fl pubin | ||
1902 | .Op Fl pubout | ||
1903 | .Op Fl text | ||
1904 | .Ek | ||
1905 | .El | ||
1906 | .Pp | ||
1907 | The | ||
1908 | .Nm ec | ||
1909 | command processes EC keys. | ||
1910 | They can be converted between various | ||
1911 | forms and their components printed out. | ||
1912 | .Nm openssl | ||
1913 | uses the private key format specified in | ||
1914 | .Dq SEC 1: Elliptic Curve Cryptography | ||
1915 | .Pq Lk https://www.secg.org/ . | ||
1916 | To convert an | ||
1917 | EC private key into the PKCS#8 private key format use the | ||
1918 | .Nm pkcs8 | ||
1919 | command. | ||
1920 | .Pp | ||
1921 | The options are as follows: | ||
1922 | .Bl -tag -width Ds | ||
1923 | .It Fl conv_form Ar arg | ||
1924 | Specify how the points on the elliptic curve are converted | ||
1925 | into octet strings. | ||
1926 | Possible values are: | ||
1927 | .Cm compressed , | ||
1928 | .Cm uncompressed | ||
1929 | (the default), | ||
1930 | and | ||
1931 | .Cm hybrid . | ||
1932 | For more information regarding | ||
1933 | the point conversion forms see the X9.62 standard. | ||
1934 | Note: | ||
1935 | Due to patent issues the | ||
1936 | .Cm compressed | ||
1937 | option is disabled by default for binary curves | ||
1938 | and can be enabled by defining the preprocessor macro | ||
1939 | .Dv OPENSSL_EC_BIN_PT_COMP | ||
1940 | at compile time. | ||
1941 | .It Fl des | des3 | ||
1942 | Encrypt the private key with DES, triple DES, or | ||
1943 | any other cipher supported by | ||
1944 | .Nm openssl . | ||
1945 | A pass phrase is prompted for. | ||
1946 | If none of these options are specified, the key is written in plain text. | ||
1947 | This means that using the | ||
1948 | .Nm ec | ||
1949 | utility to read in an encrypted key with no | ||
1950 | encryption option can be used to remove the pass phrase from a key, | ||
1951 | or by setting the encryption options | ||
1952 | it can be used to add or change the pass phrase. | ||
1953 | These options can only be used with PEM format output files. | ||
1954 | .It Fl in Ar file | ||
1955 | The input file to read a key from, | ||
1956 | or standard input if not specified. | ||
1957 | If the key is encrypted, a pass phrase will be prompted for. | ||
1958 | .It Fl inform Cm der | pem | ||
1959 | The input format. | ||
1960 | .It Fl noout | ||
1961 | Do not output the encoded version of the key. | ||
1962 | .It Fl out Ar file | ||
1963 | The output filename to write to, | ||
1964 | or standard output if not specified. | ||
1965 | If any encryption options are set then a pass phrase will be prompted for. | ||
1966 | .It Fl outform Cm der | pem | ||
1967 | The output format. | ||
1968 | .It Fl param_enc Ar arg | ||
1969 | Specify how the elliptic curve parameters are encoded. | ||
1970 | Possible value are: | ||
1971 | .Cm named_curve , | ||
1972 | i.e. the EC parameters are specified by an OID; or | ||
1973 | .Cm explicit , | ||
1974 | where the EC parameters are explicitly given | ||
1975 | (see RFC 3279 for the definition of the EC parameter structures). | ||
1976 | The default value is | ||
1977 | .Cm named_curve . | ||
1978 | Note: the | ||
1979 | .Cm implicitlyCA | ||
1980 | alternative, | ||
1981 | as specified in RFC 3279, | ||
1982 | is currently not implemented. | ||
1983 | .It Fl param_out | ||
1984 | Print the elliptic curve parameters. | ||
1985 | .It Fl passin Ar arg | ||
1986 | The key password source. | ||
1987 | .It Fl passout Ar arg | ||
1988 | The output file password source. | ||
1989 | .It Fl pubin | ||
1990 | Read in a public key, not a private key. | ||
1991 | .It Fl pubout | ||
1992 | Output a public key, not a private key. | ||
1993 | Automatically set if the input is a public key. | ||
1994 | .It Fl text | ||
1995 | Print the public/private key in plain text. | ||
1996 | .El | ||
1997 | .Tg ecparam | ||
1998 | .Sh ECPARAM | ||
1999 | .Bl -hang -width "openssl ecparam" | ||
2000 | .It Nm openssl ecparam | ||
2001 | .Bk -words | ||
2002 | .Op Fl check | ||
2003 | .Op Fl conv_form Ar arg | ||
2004 | .Op Fl genkey | ||
2005 | .Op Fl in Ar file | ||
2006 | .Op Fl inform Cm der | pem | ||
2007 | .Op Fl list_curves | ||
2008 | .Op Fl name Ar arg | ||
2009 | .Op Fl no_seed | ||
2010 | .Op Fl noout | ||
2011 | .Op Fl out Ar file | ||
2012 | .Op Fl outform Cm der | pem | ||
2013 | .Op Fl param_enc Ar arg | ||
2014 | .Op Fl text | ||
2015 | .Ek | ||
2016 | .El | ||
2017 | .Pp | ||
2018 | The | ||
2019 | .Nm ecparam | ||
2020 | command is used to manipulate or generate EC parameter files. | ||
2021 | .Nm openssl | ||
2022 | is not able to generate new groups so | ||
2023 | .Nm ecparam | ||
2024 | can only create EC parameters from known (named) curves. | ||
2025 | .Pp | ||
2026 | The options are as follows: | ||
2027 | .Bl -tag -width Ds | ||
2028 | .It Fl check | ||
2029 | Validate the elliptic curve parameters. | ||
2030 | .It Fl conv_form Ar arg | ||
2031 | Specify how the points on the elliptic curve are converted | ||
2032 | into octet strings. | ||
2033 | Possible values are: | ||
2034 | .Cm compressed , | ||
2035 | .Cm uncompressed | ||
2036 | (the default), | ||
2037 | and | ||
2038 | .Cm hybrid . | ||
2039 | For more information regarding | ||
2040 | the point conversion forms see the X9.62 standard. | ||
2041 | Note: | ||
2042 | Due to patent issues the | ||
2043 | .Cm compressed | ||
2044 | option is disabled by default for binary curves | ||
2045 | and can be enabled by defining the preprocessor macro | ||
2046 | .Dv OPENSSL_EC_BIN_PT_COMP | ||
2047 | at compile time. | ||
2048 | .It Fl genkey | ||
2049 | Generate an EC private key using the specified parameters. | ||
2050 | .It Fl in Ar file | ||
2051 | The input file to read from, | ||
2052 | or standard input if not specified. | ||
2053 | .It Fl inform Cm der | pem | ||
2054 | The input format. | ||
2055 | .It Fl list_curves | ||
2056 | Print a list of all | ||
2057 | currently implemented EC parameter names and exit. | ||
2058 | .It Fl name Ar arg | ||
2059 | Use the EC parameters with the specified "short" name. | ||
2060 | .It Fl no_seed | ||
2061 | Do not include the seed for the parameter generation | ||
2062 | in the ECParameters structure (see RFC 3279). | ||
2063 | .It Fl noout | ||
2064 | Do not output the encoded version of the parameters. | ||
2065 | .It Fl out Ar file | ||
2066 | The output file to write to, | ||
2067 | or standard output if not specified. | ||
2068 | .It Fl outform Cm der | pem | ||
2069 | The output format. | ||
2070 | .It Fl param_enc Ar arg | ||
2071 | Specify how the elliptic curve parameters are encoded. | ||
2072 | Possible value are: | ||
2073 | .Cm named_curve , | ||
2074 | i.e. the EC parameters are specified by an OID, or | ||
2075 | .Cm explicit , | ||
2076 | where the EC parameters are explicitly given | ||
2077 | (see RFC 3279 for the definition of the EC parameter structures). | ||
2078 | The default value is | ||
2079 | .Cm named_curve . | ||
2080 | Note: the | ||
2081 | .Cm implicitlyCA | ||
2082 | alternative, as specified in RFC 3279, | ||
2083 | is currently not implemented. | ||
2084 | .It Fl text | ||
2085 | Print the EC parameters in plain text. | ||
2086 | .El | ||
2087 | .Tg enc | ||
2088 | .Sh ENC | ||
2089 | .Bl -hang -width "openssl enc" | ||
2090 | .It Nm openssl enc | ||
2091 | .Bk -words | ||
2092 | .Fl ciphername | ||
2093 | .Op Fl AadePpv | ||
2094 | .Op Fl base64 | ||
2095 | .Op Fl bufsize Ar number | ||
2096 | .Op Fl debug | ||
2097 | .Op Fl in Ar file | ||
2098 | .Op Fl iter Ar iterations | ||
2099 | .Op Fl iv Ar IV | ||
2100 | .Op Fl K Ar key | ||
2101 | .Op Fl k Ar password | ||
2102 | .Op Fl kfile Ar file | ||
2103 | .Op Fl md Ar digest | ||
2104 | .Op Fl none | ||
2105 | .Op Fl nopad | ||
2106 | .Op Fl nosalt | ||
2107 | .Op Fl out Ar file | ||
2108 | .Op Fl pass Ar arg | ||
2109 | .Op Fl pbkdf2 | ||
2110 | .Op Fl S Ar salt | ||
2111 | .Op Fl salt | ||
2112 | .Ek | ||
2113 | .El | ||
2114 | .Pp | ||
2115 | The symmetric cipher commands allow data to be encrypted or decrypted | ||
2116 | using various block and stream ciphers using keys based on passwords | ||
2117 | or explicitly provided. | ||
2118 | Base64 encoding or decoding can also be performed either by itself | ||
2119 | or in addition to the encryption or decryption. | ||
2120 | The program can be called either as | ||
2121 | .Nm openssl Ar ciphername | ||
2122 | or | ||
2123 | .Nm openssl enc - Ns Ar ciphername . | ||
2124 | .Pp | ||
2125 | Some of the ciphers do not have large keys and others have security | ||
2126 | implications if not used correctly. | ||
2127 | All the block ciphers normally use PKCS#5 padding, | ||
2128 | also known as standard block padding. | ||
2129 | If padding is disabled, the input data must be a multiple of the cipher | ||
2130 | block length. | ||
2131 | .Pp | ||
2132 | The options are as follows: | ||
2133 | .Bl -tag -width Ds | ||
2134 | .It Fl A | ||
2135 | If the | ||
2136 | .Fl a | ||
2137 | option is set, then base64 process the data on one line. | ||
2138 | .It Fl a , base64 | ||
2139 | Base64 process the data. | ||
2140 | This means that if encryption is taking place, the data is base64-encoded | ||
2141 | after encryption. | ||
2142 | If decryption is set, the input data is base64-decoded before | ||
2143 | being decrypted. | ||
2144 | .It Fl bufsize Ar number | ||
2145 | Set the buffer size for I/O. | ||
2146 | .It Fl d | ||
2147 | Decrypt the input data. | ||
2148 | .It Fl debug | ||
2149 | Debug the BIOs used for I/O. | ||
2150 | .It Fl e | ||
2151 | Encrypt the input data. | ||
2152 | This is the default. | ||
2153 | .It Fl in Ar file | ||
2154 | The input file to read from, | ||
2155 | or standard input if not specified. | ||
2156 | .It Fl iter Ar iterations | ||
2157 | Use the pbkdf2 key derivation function, with | ||
2158 | .Ar iterations | ||
2159 | as the number of iterations. | ||
2160 | .It Fl iv Ar IV | ||
2161 | The actual | ||
2162 | .Ar IV | ||
2163 | .Pq initialisation vector | ||
2164 | to use: | ||
2165 | this must be represented as a string comprised only of hex digits. | ||
2166 | When only the | ||
2167 | .Ar key | ||
2168 | is specified using the | ||
2169 | .Fl K | ||
2170 | option, | ||
2171 | the IV must explicitly be defined. | ||
2172 | When a password is being specified using one of the other options, | ||
2173 | the IV is generated from this password. | ||
2174 | .It Fl K Ar key | ||
2175 | The actual | ||
2176 | .Ar key | ||
2177 | to use: | ||
2178 | this must be represented as a string comprised only of hex digits. | ||
2179 | If only the key is specified, | ||
2180 | the IV must also be specified using the | ||
2181 | .Fl iv | ||
2182 | option. | ||
2183 | When both a | ||
2184 | .Ar key | ||
2185 | and a | ||
2186 | .Ar password | ||
2187 | are specified, the | ||
2188 | .Ar key | ||
2189 | given with the | ||
2190 | .Fl K | ||
2191 | option will be used and the IV generated from the password will be taken. | ||
2192 | It probably does not make much sense to specify both | ||
2193 | .Ar key | ||
2194 | and | ||
2195 | .Ar password . | ||
2196 | .It Fl k Ar password | ||
2197 | The | ||
2198 | .Ar password | ||
2199 | to derive the key from. | ||
2200 | Superseded by the | ||
2201 | .Fl pass | ||
2202 | option. | ||
2203 | .It Fl kfile Ar file | ||
2204 | Read the password to derive the key from the first line of | ||
2205 | .Ar file . | ||
2206 | Superseded by the | ||
2207 | .Fl pass | ||
2208 | option. | ||
2209 | .It Fl md Ar digest | ||
2210 | Use | ||
2211 | .Ar digest | ||
2212 | to create a key from a pass phrase. | ||
2213 | Currently, the default value is | ||
2214 | .Cm sha256 . | ||
2215 | .It Fl none | ||
2216 | Use NULL cipher (no encryption or decryption of input). | ||
2217 | .It Fl nopad | ||
2218 | Disable standard block padding. | ||
2219 | .It Fl nosalt | ||
2220 | Don't use a salt in the key derivation routines. | ||
2221 | This option should never be used | ||
2222 | since it makes it possible to perform efficient dictionary | ||
2223 | attacks on the password and to attack stream cipher encrypted data. | ||
2224 | .It Fl out Ar file | ||
2225 | The output file to write to, | ||
2226 | or standard output if not specified. | ||
2227 | .It Fl P | ||
2228 | Print out the salt, key, and IV used, then immediately exit; | ||
2229 | don't do any encryption or decryption. | ||
2230 | .It Fl p | ||
2231 | Print out the salt, key, and IV used. | ||
2232 | .It Fl pass Ar arg | ||
2233 | The password source. | ||
2234 | .It Fl pbkdf2 | ||
2235 | Use the pbkdf2 key derivation function, with | ||
2236 | the default of 10000 iterations. | ||
2237 | .It Fl S Ar salt | ||
2238 | The actual | ||
2239 | .Ar salt | ||
2240 | to use: | ||
2241 | this must be represented as a string comprised only of hex digits. | ||
2242 | .It Fl salt | ||
2243 | Use a salt in the key derivation routines (the default). | ||
2244 | When the salt is being used, | ||
2245 | the first eight bytes of the encrypted data are reserved for the salt: | ||
2246 | it is randomly generated when encrypting a file and read from the | ||
2247 | encrypted file when it is decrypted. | ||
2248 | .It Fl v | ||
2249 | Print extra details about the processing. | ||
2250 | .El | ||
2251 | .Tg errstr | ||
2252 | .Sh ERRSTR | ||
2253 | .Nm openssl errstr | ||
2254 | .Ar errno ... | ||
2255 | .Pp | ||
2256 | The | ||
2257 | .Nm errstr | ||
2258 | command performs error number to error string conversion, | ||
2259 | generating a human-readable string representing the error code | ||
2260 | .Ar errno . | ||
2261 | The string is obtained through the | ||
2262 | .Xr ERR_error_string_n 3 | ||
2263 | function and has the following format: | ||
2264 | .Pp | ||
2265 | .Dl error:[error code]:[library name]:[function name]:[reason string] | ||
2266 | .Pp | ||
2267 | .Bq error code | ||
2268 | is an 8-digit hexadecimal number. | ||
2269 | The remaining fields | ||
2270 | .Bq library name , | ||
2271 | .Bq function name , | ||
2272 | and | ||
2273 | .Bq reason string | ||
2274 | are all ASCII text. | ||
2275 | .Tg gendsa | ||
2276 | .Sh GENDSA | ||
2277 | .Bl -hang -width "openssl gendsa" | ||
2278 | .It Nm openssl gendsa | ||
2279 | .Bk -words | ||
2280 | .Oo | ||
2281 | .Fl aes128 | aes192 | aes256 | camellia128 | | ||
2282 | .Fl camellia192 | camellia256 | des | des3 | idea | ||
2283 | .Oc | ||
2284 | .Op Fl out Ar file | ||
2285 | .Op Fl passout Ar arg | ||
2286 | .Ar paramfile | ||
2287 | .Ek | ||
2288 | .El | ||
2289 | .Pp | ||
2290 | The | ||
2291 | .Nm gendsa | ||
2292 | command generates a DSA private key from a DSA parameter file | ||
2293 | (typically generated by the | ||
2294 | .Nm openssl dsaparam | ||
2295 | command). | ||
2296 | DSA key generation is little more than random number generation so it is | ||
2297 | much quicker than, | ||
2298 | for example, | ||
2299 | RSA key generation. | ||
2300 | .Pp | ||
2301 | The options are as follows: | ||
2302 | .Bl -tag -width Ds | ||
2303 | .It Xo | ||
2304 | .Fl aes128 | aes192 | aes256 | | ||
2305 | .Fl camellia128 | camellia192 | camellia256 | | ||
2306 | .Fl des | des3 | | ||
2307 | .Fl idea | ||
2308 | .Xc | ||
2309 | Encrypt the private key with the AES, CAMELLIA, DES, triple DES | ||
2310 | or the IDEA ciphers, respectively, before outputting it. | ||
2311 | A pass phrase is prompted for. | ||
2312 | If none of these options are specified, no encryption is used. | ||
2313 | .It Fl out Ar file | ||
2314 | The output file to write to, | ||
2315 | or standard output if not specified. | ||
2316 | .It Fl passout Ar arg | ||
2317 | The output file password source. | ||
2318 | .It Ar paramfile | ||
2319 | Specify the DSA parameter file to use. | ||
2320 | The parameters in this file determine the size of the private key. | ||
2321 | .El | ||
2322 | .Tg genpkey | ||
2323 | .Sh GENPKEY | ||
2324 | .Bl -hang -width "openssl genpkey" | ||
2325 | .It Nm openssl genpkey | ||
2326 | .Bk -words | ||
2327 | .Op Fl algorithm Ar alg | ||
2328 | .Op Ar cipher | ||
2329 | .Op Fl genparam | ||
2330 | .Op Fl out Ar file | ||
2331 | .Op Fl outform Cm der | pem | ||
2332 | .Op Fl paramfile Ar file | ||
2333 | .Op Fl pass Ar arg | ||
2334 | .Op Fl pkeyopt Ar opt : Ns Ar value | ||
2335 | .Op Fl text | ||
2336 | .Ek | ||
2337 | .El | ||
2338 | .Pp | ||
2339 | The | ||
2340 | .Nm genpkey | ||
2341 | command generates private keys. | ||
2342 | The use of this | ||
2343 | program is encouraged over the algorithm specific utilities | ||
2344 | because additional algorithm options can be used. | ||
2345 | .Pp | ||
2346 | The options are as follows: | ||
2347 | .Bl -tag -width Ds | ||
2348 | .It Fl algorithm Ar alg | ||
2349 | The public key algorithm to use, | ||
2350 | such as RSA, DSA, or DH. | ||
2351 | This option must precede any | ||
2352 | .Fl pkeyopt | ||
2353 | options. | ||
2354 | The options | ||
2355 | .Fl paramfile | ||
2356 | and | ||
2357 | .Fl algorithm | ||
2358 | are mutually exclusive. | ||
2359 | .It Ar cipher | ||
2360 | Encrypt the private key with the supplied cipher. | ||
2361 | Any algorithm name accepted by | ||
2362 | .Xr EVP_get_cipherbyname 3 | ||
2363 | is acceptable. | ||
2364 | .It Fl genparam | ||
2365 | Generate a set of parameters instead of a private key. | ||
2366 | This option must precede any | ||
2367 | .Fl algorithm , | ||
2368 | .Fl paramfile , | ||
2369 | or | ||
2370 | .Fl pkeyopt | ||
2371 | options. | ||
2372 | .It Fl out Ar file | ||
2373 | The output file to write to, | ||
2374 | or standard output if not specified. | ||
2375 | .It Fl outform Cm der | pem | ||
2376 | The output format. | ||
2377 | .It Fl paramfile Ar file | ||
2378 | Some public key algorithms generate a private key based on a set of parameters, | ||
2379 | which can be supplied using this option. | ||
2380 | If this option is used, the public key | ||
2381 | algorithm used is determined by the parameters. | ||
2382 | This option must precede any | ||
2383 | .Fl pkeyopt | ||
2384 | options. | ||
2385 | The options | ||
2386 | .Fl paramfile | ||
2387 | and | ||
2388 | .Fl algorithm | ||
2389 | are mutually exclusive. | ||
2390 | .It Fl pass Ar arg | ||
2391 | The output file password source. | ||
2392 | .It Fl pkeyopt Ar opt : Ns Ar value | ||
2393 | Set the public key algorithm option | ||
2394 | .Ar opt | ||
2395 | to | ||
2396 | .Ar value , | ||
2397 | as follows: | ||
2398 | .Bl -tag -width Ds -offset indent | ||
2399 | .It rsa_keygen_bits : Ns Ar numbits | ||
2400 | (RSA) | ||
2401 | The number of bits in the generated key. | ||
2402 | The default is 2048. | ||
2403 | .It rsa_keygen_pubexp : Ns Ar value | ||
2404 | (RSA) | ||
2405 | The RSA public exponent value. | ||
2406 | This can be a large decimal or hexadecimal value if preceded by 0x. | ||
2407 | The default is 65537. | ||
2408 | .It dsa_paramgen_bits : Ns Ar numbits | ||
2409 | (DSA) | ||
2410 | The number of bits in the generated parameters. | ||
2411 | The default is 1024. | ||
2412 | .It dh_paramgen_prime_len : Ns Ar numbits | ||
2413 | (DH) | ||
2414 | The number of bits in the prime parameter | ||
2415 | .Ar p . | ||
2416 | .It dh_paramgen_generator : Ns Ar value | ||
2417 | (DH) | ||
2418 | The value to use for the generator | ||
2419 | .Ar g . | ||
2420 | .It ec_paramgen_curve : Ns Ar curve | ||
2421 | (EC) | ||
2422 | The elliptic curve to use. | ||
2423 | .El | ||
2424 | .It Fl text | ||
2425 | Print the private/public key in plain text. | ||
2426 | .El | ||
2427 | .Tg genrsa | ||
2428 | .Sh GENRSA | ||
2429 | .Bl -hang -width "openssl genrsa" | ||
2430 | .It Nm openssl genrsa | ||
2431 | .Bk -words | ||
2432 | .Op Fl 3 | f4 | ||
2433 | .Oo | ||
2434 | .Fl aes128 | aes192 | aes256 | camellia128 | | ||
2435 | .Fl camellia192 | camellia256 | des | des3 | idea | ||
2436 | .Oc | ||
2437 | .Op Fl out Ar file | ||
2438 | .Op Fl passout Ar arg | ||
2439 | .Op Ar numbits | ||
2440 | .Ek | ||
2441 | .El | ||
2442 | .Pp | ||
2443 | The | ||
2444 | .Nm genrsa | ||
2445 | command generates an RSA private key, | ||
2446 | which essentially involves the generation of two prime numbers. | ||
2447 | When generating the key, | ||
2448 | various symbols will be output to indicate the progress of the generation. | ||
2449 | A | ||
2450 | .Sq \&. | ||
2451 | represents each number which has passed an initial sieve test; | ||
2452 | .Sq + | ||
2453 | means a number has passed a single round of the Miller-Rabin primality test; | ||
2454 | .Sq * | ||
2455 | means the number has failed primality testing | ||
2456 | and needs to be generated afresh. | ||
2457 | A newline means that the number has passed all the prime tests | ||
2458 | (the actual number depends on the key size). | ||
2459 | .Pp | ||
2460 | The options are as follows: | ||
2461 | .Bl -tag -width Ds | ||
2462 | .It Fl 3 | f4 | ||
2463 | The public exponent to use, either 3 or 65537. | ||
2464 | The default is 65537. | ||
2465 | .It Xo | ||
2466 | .Fl aes128 | aes192 | aes256 | | ||
2467 | .Fl camellia128 | camellia192 | camellia256 | | ||
2468 | .Fl des | des3 | | ||
2469 | .Fl idea | ||
2470 | .Xc | ||
2471 | Encrypt the private key with the AES, CAMELLIA, DES, triple DES | ||
2472 | or the IDEA ciphers, respectively, before outputting it. | ||
2473 | If none of these options are specified, no encryption is used. | ||
2474 | If encryption is used, a pass phrase is prompted for, | ||
2475 | if it is not supplied via the | ||
2476 | .Fl passout | ||
2477 | option. | ||
2478 | .It Fl out Ar file | ||
2479 | The output file to write to, | ||
2480 | or standard output if not specified. | ||
2481 | .It Fl passout Ar arg | ||
2482 | The output file password source. | ||
2483 | .It Ar numbits | ||
2484 | The size of the private key to generate in bits. | ||
2485 | This must be the last option specified. | ||
2486 | The default is 2048. | ||
2487 | .El | ||
2488 | .Tg ocsp | ||
2489 | .Sh OCSP | ||
2490 | .Bl -hang -width "openssl ocsp" | ||
2491 | .It Nm openssl ocsp | ||
2492 | .Bk -words | ||
2493 | .Op Fl CA Ar file | ||
2494 | .Op Fl CAfile Ar file | ||
2495 | .Op Fl CApath Ar directory | ||
2496 | .Op Fl cert Ar file | ||
2497 | .Op Fl dgst Ar alg | ||
2498 | .Op Fl header Ar name value | ||
2499 | .Op Fl host Ar hostname : Ns Ar port | ||
2500 | .Op Fl ignore_err | ||
2501 | .Op Fl index Ar indexfile | ||
2502 | .Op Fl issuer Ar file | ||
2503 | .Op Fl ndays Ar days | ||
2504 | .Op Fl nmin Ar minutes | ||
2505 | .Op Fl no_cert_checks | ||
2506 | .Op Fl no_cert_verify | ||
2507 | .Op Fl no_certs | ||
2508 | .Op Fl no_chain | ||
2509 | .Op Fl no_explicit | ||
2510 | .Op Fl no_intern | ||
2511 | .Op Fl no_nonce | ||
2512 | .Op Fl no_signature_verify | ||
2513 | .Op Fl nonce | ||
2514 | .Op Fl noverify | ||
2515 | .Op Fl nrequest Ar number | ||
2516 | .Op Fl out Ar file | ||
2517 | .Op Fl path Ar path | ||
2518 | .Op Fl port Ar portnum | ||
2519 | .Op Fl req_text | ||
2520 | .Op Fl reqin Ar file | ||
2521 | .Op Fl reqout Ar file | ||
2522 | .Op Fl resp_key_id | ||
2523 | .Op Fl resp_no_certs | ||
2524 | .Op Fl resp_text | ||
2525 | .Op Fl respin Ar file | ||
2526 | .Op Fl respout Ar file | ||
2527 | .Op Fl rkey Ar file | ||
2528 | .Op Fl rother Ar file | ||
2529 | .Op Fl rsigner Ar file | ||
2530 | .Op Fl serial Ar num | ||
2531 | .Op Fl sign_other Ar file | ||
2532 | .Op Fl signer Ar file | ||
2533 | .Op Fl signkey Ar file | ||
2534 | .Op Fl status_age Ar age | ||
2535 | .Op Fl text | ||
2536 | .Op Fl timeout Ar seconds | ||
2537 | .Op Fl trust_other | ||
2538 | .Op Fl url Ar responder_url | ||
2539 | .Op Fl VAfile Ar file | ||
2540 | .Op Fl validity_period Ar nsec | ||
2541 | .Op Fl verify_other Ar file | ||
2542 | .Ek | ||
2543 | .El | ||
2544 | .Pp | ||
2545 | The Online Certificate Status Protocol (OCSP) | ||
2546 | enables applications to determine the (revocation) state | ||
2547 | of an identified certificate (RFC 2560). | ||
2548 | .Pp | ||
2549 | The | ||
2550 | .Nm ocsp | ||
2551 | command performs many common OCSP tasks. | ||
2552 | It can be used to print out requests and responses, | ||
2553 | create requests and send queries to an OCSP responder, | ||
2554 | and behave like a mini OCSP server itself. | ||
2555 | .Pp | ||
2556 | The options are as follows: | ||
2557 | .Bl -tag -width Ds | ||
2558 | .It Fl CAfile Ar file , Fl CApath Ar directory | ||
2559 | A file or path containing trusted CA certificates, | ||
2560 | used to verify the signature on the OCSP response. | ||
2561 | .It Fl cert Ar file | ||
2562 | Add the certificate | ||
2563 | .Ar file | ||
2564 | to the request. | ||
2565 | The issuer certificate is taken from the previous | ||
2566 | .Fl issuer | ||
2567 | option, or an error occurs if no issuer certificate is specified. | ||
2568 | .It Fl dgst Ar alg | ||
2569 | Use the digest algorithm | ||
2570 | .Ar alg | ||
2571 | for certificate identification in the OCSP request. | ||
2572 | By default SHA1 is used. | ||
2573 | .It Xo | ||
2574 | .Fl host Ar hostname : Ns Ar port , | ||
2575 | .Fl path Ar path | ||
2576 | .Xc | ||
2577 | Send | ||
2578 | the OCSP request to | ||
2579 | .Ar hostname | ||
2580 | on | ||
2581 | .Ar port . | ||
2582 | .Fl path | ||
2583 | specifies the HTTP path name to use, or | ||
2584 | .Pa / | ||
2585 | by default. | ||
2586 | .It Fl header Ar name value | ||
2587 | Add the header name with the specified value to the OCSP request that is sent | ||
2588 | to the responder. | ||
2589 | This may be repeated. | ||
2590 | .It Fl issuer Ar file | ||
2591 | The current issuer certificate, in PEM format. | ||
2592 | Can be used multiple times and must come before any | ||
2593 | .Fl cert | ||
2594 | options. | ||
2595 | .It Fl no_cert_checks | ||
2596 | Don't perform any additional checks on the OCSP response signer's certificate. | ||
2597 | That is, do not make any checks to see if the signer's certificate is | ||
2598 | authorised to provide the necessary status information: | ||
2599 | as a result this option should only be used for testing purposes. | ||
2600 | .It Fl no_cert_verify | ||
2601 | Don't verify the OCSP response signer's certificate at all. | ||
2602 | Since this option allows the OCSP response to be signed by any certificate, | ||
2603 | it should only be used for testing purposes. | ||
2604 | .It Fl no_certs | ||
2605 | Don't include any certificates in the signed request. | ||
2606 | .It Fl no_chain | ||
2607 | Do not use certificates in the response as additional untrusted CA | ||
2608 | certificates. | ||
2609 | .It Fl no_explicit | ||
2610 | Don't check the explicit trust for OCSP signing in the root CA certificate. | ||
2611 | .It Fl no_intern | ||
2612 | Ignore certificates contained in the OCSP response | ||
2613 | when searching for the signer's certificate. | ||
2614 | The signer's certificate must be specified with either the | ||
2615 | .Fl verify_other | ||
2616 | or | ||
2617 | .Fl VAfile | ||
2618 | options. | ||
2619 | .It Fl no_signature_verify | ||
2620 | Don't check the signature on the OCSP response. | ||
2621 | Since this option tolerates invalid signatures on OCSP responses, | ||
2622 | it will normally only be used for testing purposes. | ||
2623 | .It Fl nonce , no_nonce | ||
2624 | Add an OCSP nonce extension to a request, | ||
2625 | or disable an OCSP nonce addition. | ||
2626 | Normally, if an OCSP request is input using the | ||
2627 | .Fl respin | ||
2628 | option no nonce is added: | ||
2629 | using the | ||
2630 | .Fl nonce | ||
2631 | option will force the addition of a nonce. | ||
2632 | If an OCSP request is being created (using the | ||
2633 | .Fl cert | ||
2634 | and | ||
2635 | .Fl serial | ||
2636 | options), | ||
2637 | a nonce is automatically added; specifying | ||
2638 | .Fl no_nonce | ||
2639 | overrides this. | ||
2640 | .It Fl noverify | ||
2641 | Don't attempt to verify the OCSP response signature or the nonce values. | ||
2642 | This is normally only be used for debugging | ||
2643 | since it disables all verification of the responder's certificate. | ||
2644 | .It Fl out Ar file | ||
2645 | Specify the output file to write to, | ||
2646 | or standard output if not specified. | ||
2647 | .It Fl req_text , resp_text , text | ||
2648 | Print out the text form of the OCSP request, response, or both, respectively. | ||
2649 | .It Fl reqin Ar file , Fl respin Ar file | ||
2650 | Read an OCSP request or response file from | ||
2651 | .Ar file . | ||
2652 | These options are ignored | ||
2653 | if an OCSP request or response creation is implied by other options | ||
2654 | (for example with the | ||
2655 | .Fl serial , cert , | ||
2656 | and | ||
2657 | .Fl host | ||
2658 | options). | ||
2659 | .It Fl reqout Ar file , Fl respout Ar file | ||
2660 | Write out the DER-encoded certificate request or response to | ||
2661 | .Ar file . | ||
2662 | .It Fl serial Ar num | ||
2663 | Same as the | ||
2664 | .Fl cert | ||
2665 | option except the certificate with serial number | ||
2666 | .Ar num | ||
2667 | is added to the request. | ||
2668 | The serial number is interpreted as a decimal integer unless preceded by | ||
2669 | .Sq 0x . | ||
2670 | Negative integers can also be specified | ||
2671 | by preceding the value with a minus sign. | ||
2672 | .It Fl sign_other Ar file | ||
2673 | Additional certificates to include in the signed request. | ||
2674 | .It Fl signer Ar file , Fl signkey Ar file | ||
2675 | Sign the OCSP request using the certificate specified in the | ||
2676 | .Fl signer | ||
2677 | option and the private key specified by the | ||
2678 | .Fl signkey | ||
2679 | option. | ||
2680 | If the | ||
2681 | .Fl signkey | ||
2682 | option is not present, then the private key is read from the same file | ||
2683 | as the certificate. | ||
2684 | If neither option is specified, the OCSP request is not signed. | ||
2685 | .It Fl timeout Ar seconds | ||
2686 | Connection timeout to the OCSP responder in seconds. | ||
2687 | .It Fl trust_other | ||
2688 | The certificates specified by the | ||
2689 | .Fl verify_other | ||
2690 | option should be explicitly trusted and no additional checks will be | ||
2691 | performed on them. | ||
2692 | This is useful when the complete responder certificate chain is not available | ||
2693 | or trusting a root CA is not appropriate. | ||
2694 | .It Fl url Ar responder_url | ||
2695 | Specify the responder URL. | ||
2696 | Both HTTP and HTTPS | ||
2697 | .Pq SSL/TLS | ||
2698 | URLs can be specified. | ||
2699 | .It Fl VAfile Ar file | ||
2700 | A file containing explicitly trusted responder certificates. | ||
2701 | Equivalent to the | ||
2702 | .Fl verify_other | ||
2703 | and | ||
2704 | .Fl trust_other | ||
2705 | options. | ||
2706 | .It Fl validity_period Ar nsec , Fl status_age Ar age | ||
2707 | The range of times, in seconds, which will be tolerated in an OCSP response. | ||
2708 | Each certificate status response includes a notBefore time | ||
2709 | and an optional notAfter time. | ||
2710 | The current time should fall between these two values, | ||
2711 | but the interval between the two times may be only a few seconds. | ||
2712 | In practice the OCSP responder and clients' clocks may not be precisely | ||
2713 | synchronised and so such a check may fail. | ||
2714 | To avoid this the | ||
2715 | .Fl validity_period | ||
2716 | option can be used to specify an acceptable error range in seconds, | ||
2717 | the default value being 5 minutes. | ||
2718 | .Pp | ||
2719 | If the notAfter time is omitted from a response, | ||
2720 | it means that new status information is immediately available. | ||
2721 | In this case the age of the notBefore field is checked | ||
2722 | to see it is not older than | ||
2723 | .Ar age | ||
2724 | seconds old. | ||
2725 | By default, this additional check is not performed. | ||
2726 | .It Fl verify_other Ar file | ||
2727 | A file containing additional certificates to search | ||
2728 | when attempting to locate the OCSP response signing certificate. | ||
2729 | Some responders omit the actual signer's certificate from the response, | ||
2730 | so this can be used to supply the necessary certificate. | ||
2731 | .El | ||
2732 | .Pp | ||
2733 | The options for the OCSP server are as follows: | ||
2734 | .Bl -tag -width "XXXX" | ||
2735 | .It Fl CA Ar file | ||
2736 | CA certificate corresponding to the revocation information in | ||
2737 | .Ar indexfile . | ||
2738 | .It Fl ignore_err | ||
2739 | Ignore the invalid response. | ||
2740 | .It Fl index Ar indexfile | ||
2741 | .Ar indexfile | ||
2742 | is a text index file in ca format | ||
2743 | containing certificate revocation information. | ||
2744 | .Pp | ||
2745 | If this option is specified, | ||
2746 | .Nm ocsp | ||
2747 | is in responder mode, otherwise it is in client mode. | ||
2748 | The requests the responder processes can be either specified on | ||
2749 | the command line (using the | ||
2750 | .Fl issuer | ||
2751 | and | ||
2752 | .Fl serial | ||
2753 | options), supplied in a file (using the | ||
2754 | .Fl respin | ||
2755 | option), or via external OCSP clients (if | ||
2756 | .Ar port | ||
2757 | or | ||
2758 | .Ar url | ||
2759 | is specified). | ||
2760 | .Pp | ||
2761 | If this option is present, then the | ||
2762 | .Fl CA | ||
2763 | and | ||
2764 | .Fl rsigner | ||
2765 | options must also be present. | ||
2766 | .It Fl nmin Ar minutes , Fl ndays Ar days | ||
2767 | Number of | ||
2768 | .Ar minutes | ||
2769 | or | ||
2770 | .Ar days | ||
2771 | when fresh revocation information is available: | ||
2772 | used in the nextUpdate field. | ||
2773 | If neither option is present, | ||
2774 | the nextUpdate field is omitted, | ||
2775 | meaning fresh revocation information is immediately available. | ||
2776 | .It Fl nrequest Ar number | ||
2777 | Exit after receiving | ||
2778 | .Ar number | ||
2779 | requests (the default is unlimited). | ||
2780 | .It Fl port Ar portnum | ||
2781 | Port to listen for OCSP requests on. | ||
2782 | May also be specified using the | ||
2783 | .Fl url | ||
2784 | option. | ||
2785 | .It Fl resp_key_id | ||
2786 | Identify the signer certificate using the key ID; | ||
2787 | the default is to use the subject name. | ||
2788 | .It Fl resp_no_certs | ||
2789 | Don't include any certificates in the OCSP response. | ||
2790 | .It Fl rkey Ar file | ||
2791 | The private key to sign OCSP responses with; | ||
2792 | if not present, the file specified in the | ||
2793 | .Fl rsigner | ||
2794 | option is used. | ||
2795 | .It Fl rother Ar file | ||
2796 | Additional certificates to include in the OCSP response. | ||
2797 | .It Fl rsigner Ar file | ||
2798 | The certificate to sign OCSP responses with. | ||
2799 | .El | ||
2800 | .Pp | ||
2801 | Initially the OCSP responder certificate is located and the signature on | ||
2802 | the OCSP request checked using the responder certificate's public key. | ||
2803 | Then a normal certificate verify is performed on the OCSP responder certificate | ||
2804 | building up a certificate chain in the process. | ||
2805 | The locations of the trusted certificates used to build the chain can be | ||
2806 | specified by the | ||
2807 | .Fl CAfile | ||
2808 | and | ||
2809 | .Fl CApath | ||
2810 | options or they will be looked for in the standard | ||
2811 | .Nm openssl | ||
2812 | certificates directory. | ||
2813 | .Pp | ||
2814 | If the initial verify fails, the OCSP verify process halts with an error. | ||
2815 | Otherwise the issuing CA certificate in the request is compared to the OCSP | ||
2816 | responder certificate: if there is a match then the OCSP verify succeeds. | ||
2817 | .Pp | ||
2818 | Otherwise the OCSP responder certificate's CA is checked against the issuing | ||
2819 | CA certificate in the request. | ||
2820 | If there is a match and the OCSPSigning extended key usage is present | ||
2821 | in the OCSP responder certificate, then the OCSP verify succeeds. | ||
2822 | .Pp | ||
2823 | Otherwise the root CA of the OCSP responder's CA is checked to see if it | ||
2824 | is trusted for OCSP signing. | ||
2825 | If it is, the OCSP verify succeeds. | ||
2826 | .Pp | ||
2827 | If none of these checks is successful, the OCSP verify fails. | ||
2828 | What this effectively means is that if the OCSP responder certificate is | ||
2829 | authorised directly by the CA it is issuing revocation information about | ||
2830 | (and it is correctly configured), | ||
2831 | then verification will succeed. | ||
2832 | .Pp | ||
2833 | If the OCSP responder is a global responder, | ||
2834 | which can give details about multiple CAs | ||
2835 | and has its own separate certificate chain, | ||
2836 | then its root CA can be trusted for OCSP signing. | ||
2837 | Alternatively, the responder certificate itself can be explicitly trusted | ||
2838 | with the | ||
2839 | .Fl VAfile | ||
2840 | option. | ||
2841 | .Tg passwd | ||
2842 | .Sh PASSWD | ||
2843 | .Bl -hang -width "openssl passwd" | ||
2844 | .It Nm openssl passwd | ||
2845 | .Bk -words | ||
2846 | .Op Fl 1 | apr1 | crypt | ||
2847 | .Op Fl in Ar file | ||
2848 | .Op Fl noverify | ||
2849 | .Op Fl quiet | ||
2850 | .Op Fl reverse | ||
2851 | .Op Fl salt Ar string | ||
2852 | .Op Fl stdin | ||
2853 | .Op Fl table | ||
2854 | .Op Ar password | ||
2855 | .Ek | ||
2856 | .El | ||
2857 | .Pp | ||
2858 | The | ||
2859 | .Nm passwd | ||
2860 | command computes the hash of a password. | ||
2861 | .Pp | ||
2862 | The options are as follows: | ||
2863 | .Bl -tag -width Ds | ||
2864 | .It Fl 1 | ||
2865 | Use the MD5 based | ||
2866 | .Bx | ||
2867 | password algorithm | ||
2868 | .Qq 1 . | ||
2869 | .It Fl apr1 | ||
2870 | Use the | ||
2871 | .Qq apr1 | ||
2872 | algorithm | ||
2873 | .Po | ||
2874 | Apache variant of the | ||
2875 | .Bx | ||
2876 | algorithm | ||
2877 | .Pc . | ||
2878 | .It Fl crypt | ||
2879 | Use the | ||
2880 | .Qq crypt | ||
2881 | algorithm (the default). | ||
2882 | .It Fl in Ar file | ||
2883 | Read passwords from | ||
2884 | .Ar file . | ||
2885 | .It Fl noverify | ||
2886 | Don't verify when reading a password from the terminal. | ||
2887 | .It Fl quiet | ||
2888 | Don't output warnings when passwords given on the command line are truncated. | ||
2889 | .It Fl reverse | ||
2890 | Switch table columns. | ||
2891 | This only makes sense in conjunction with the | ||
2892 | .Fl table | ||
2893 | option. | ||
2894 | .It Fl salt Ar string | ||
2895 | Use the salt specified by | ||
2896 | .Ar string . | ||
2897 | When reading a password from the terminal, this implies | ||
2898 | .Fl noverify . | ||
2899 | .It Fl stdin | ||
2900 | Read passwords from standard input. | ||
2901 | .It Fl table | ||
2902 | In the output list, prepend the cleartext password and a TAB character | ||
2903 | to each password hash. | ||
2904 | .El | ||
2905 | .Tg pkcs7 | ||
2906 | .Sh PKCS7 | ||
2907 | .Bl -hang -width "openssl pkcs7" | ||
2908 | .It Nm openssl pkcs7 | ||
2909 | .Bk -words | ||
2910 | .Op Fl in Ar file | ||
2911 | .Op Fl inform Cm der | pem | ||
2912 | .Op Fl noout | ||
2913 | .Op Fl out Ar file | ||
2914 | .Op Fl outform Cm der | pem | ||
2915 | .Op Fl print | ||
2916 | .Op Fl print_certs | ||
2917 | .Op Fl text | ||
2918 | .Ek | ||
2919 | .El | ||
2920 | .Pp | ||
2921 | The | ||
2922 | .Nm pkcs7 | ||
2923 | command processes PKCS#7 files in DER or PEM format. | ||
2924 | The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315. | ||
2925 | .Pp | ||
2926 | The options are as follows: | ||
2927 | .Bl -tag -width Ds | ||
2928 | .It Fl in Ar file | ||
2929 | The input file to read from, | ||
2930 | or standard input if not specified. | ||
2931 | .It Fl inform Cm der | pem | ||
2932 | The input format. | ||
2933 | .It Fl noout | ||
2934 | Don't output the encoded version of the PKCS#7 structure | ||
2935 | (or certificates if | ||
2936 | .Fl print_certs | ||
2937 | is set). | ||
2938 | .It Fl out Ar file | ||
2939 | The output to write to, | ||
2940 | or standard output if not specified. | ||
2941 | .It Fl outform Cm der | pem | ||
2942 | The output format. | ||
2943 | .It Fl print | ||
2944 | Print the ASN.1 representation of PKCS#7 structure. | ||
2945 | .It Fl print_certs | ||
2946 | Print any certificates or CRLs contained in the file, | ||
2947 | preceded by their subject and issuer names in a one-line format. | ||
2948 | .It Fl text | ||
2949 | Print certificate details in full rather than just subject and issuer names. | ||
2950 | .El | ||
2951 | .Tg pkcs8 | ||
2952 | .Sh PKCS8 | ||
2953 | .Bl -hang -width "openssl pkcs8" | ||
2954 | .It Nm openssl pkcs8 | ||
2955 | .Bk -words | ||
2956 | .Op Fl in Ar file | ||
2957 | .Op Fl inform Cm der | pem | ||
2958 | .Op Fl nocrypt | ||
2959 | .Op Fl noiter | ||
2960 | .Op Fl out Ar file | ||
2961 | .Op Fl outform Cm der | pem | ||
2962 | .Op Fl passin Ar arg | ||
2963 | .Op Fl passout Ar arg | ||
2964 | .Op Fl topk8 | ||
2965 | .Op Fl v1 Ar alg | ||
2966 | .Op Fl v2 Ar alg | ||
2967 | .Ek | ||
2968 | .El | ||
2969 | .Pp | ||
2970 | The | ||
2971 | .Nm pkcs8 | ||
2972 | command processes private keys | ||
2973 | (both encrypted and unencrypted) | ||
2974 | in PKCS#8 format | ||
2975 | with a variety of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms. | ||
2976 | The default encryption is only 56 bits; | ||
2977 | keys encrypted using PKCS#5 v2.0 algorithms and high iteration counts | ||
2978 | are more secure. | ||
2979 | .Pp | ||
2980 | The options are as follows: | ||
2981 | .Bl -tag -width Ds | ||
2982 | .It Fl in Ar file | ||
2983 | The input file to read from, | ||
2984 | or standard input if not specified. | ||
2985 | If the key is encrypted, a pass phrase will be prompted for. | ||
2986 | .It Fl inform Cm der | pem | ||
2987 | The input format. | ||
2988 | .It Fl nocrypt | ||
2989 | Generate an unencrypted PrivateKeyInfo structure. | ||
2990 | This option does not encrypt private keys at all | ||
2991 | and should only be used when absolutely necessary. | ||
2992 | .It Fl noiter | ||
2993 | Use an iteration count of 1. | ||
2994 | See the | ||
2995 | .Sx PKCS12 | ||
2996 | section below for a detailed explanation of this option. | ||
2997 | .It Fl out Ar file | ||
2998 | The output file to write to, | ||
2999 | or standard output if none is specified. | ||
3000 | If any encryption options are set, a pass phrase will be prompted for. | ||
3001 | .It Fl outform Cm der | pem | ||
3002 | The output format. | ||
3003 | .It Fl passin Ar arg | ||
3004 | The key password source. | ||
3005 | .It Fl passout Ar arg | ||
3006 | The output file password source. | ||
3007 | .It Fl topk8 | ||
3008 | Read a traditional format private key and write a PKCS#8 format key. | ||
3009 | .It Fl v1 Ar alg | ||
3010 | Specify a PKCS#5 v1.5 or PKCS#12 algorithm to use. | ||
3011 | .Pp | ||
3012 | .Bl -tag -width "XXXX" -compact | ||
3013 | .It PBE-MD5-DES | ||
3014 | 56-bit DES. | ||
3015 | .It PBE-SHA1-RC2-64 | PBE-MD5-RC2-64 | PBE-SHA1-DES | ||
3016 | 64-bit RC2 or 56-bit DES. | ||
3017 | .It PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES | ||
3018 | .It PBE-SHA1-2DES | PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40 | ||
3019 | PKCS#12 password-based encryption algorithm, | ||
3020 | which allow strong encryption algorithms like triple DES or 128-bit RC2. | ||
3021 | .El | ||
3022 | .It Fl v2 Ar alg | ||
3023 | Use PKCS#5 v2.0 algorithms. | ||
3024 | Supports algorithms such as 168-bit triple DES or 128-bit RC2, | ||
3025 | however not many implementations support PKCS#5 v2.0 yet | ||
3026 | (if using private keys with | ||
3027 | .Nm openssl | ||
3028 | this doesn't matter). | ||
3029 | .Pp | ||
3030 | .Ar alg | ||
3031 | is the encryption algorithm to use; | ||
3032 | valid values include des, des3, and rc2. | ||
3033 | It is recommended that des3 is used. | ||
3034 | .El | ||
3035 | .Tg pkcs12 | ||
3036 | .Sh PKCS12 | ||
3037 | .Bl -hang -width "openssl pkcs12" | ||
3038 | .It Nm openssl pkcs12 | ||
3039 | .Bk -words | ||
3040 | .Oo | ||
3041 | .Fl aes128 | aes192 | aes256 | camellia128 | | ||
3042 | .Fl camellia192 | camellia256 | des | des3 | idea | ||
3043 | .Oc | ||
3044 | .Op Fl cacerts | ||
3045 | .Op Fl CAfile Ar file | ||
3046 | .Op Fl caname Ar name | ||
3047 | .Op Fl CApath Ar directory | ||
3048 | .Op Fl certfile Ar file | ||
3049 | .Op Fl certpbe Ar alg | ||
3050 | .Op Fl chain | ||
3051 | .Op Fl clcerts | ||
3052 | .Op Fl descert | ||
3053 | .Op Fl export | ||
3054 | .Op Fl in Ar file | ||
3055 | .Op Fl info | ||
3056 | .Op Fl inkey Ar file | ||
3057 | .Op Fl keyex | ||
3058 | .Op Fl keypbe Ar alg | ||
3059 | .Op Fl keysig | ||
3060 | .Op Fl macalg Ar alg | ||
3061 | .Op Fl maciter | ||
3062 | .Op Fl name Ar name | ||
3063 | .Op Fl nocerts | ||
3064 | .Op Fl nodes | ||
3065 | .Op Fl noiter | ||
3066 | .Op Fl nokeys | ||
3067 | .Op Fl nomac | ||
3068 | .Op Fl nomaciter | ||
3069 | .Op Fl nomacver | ||
3070 | .Op Fl noout | ||
3071 | .Op Fl out Ar file | ||
3072 | .Op Fl passin Ar arg | ||
3073 | .Op Fl passout Ar arg | ||
3074 | .Op Fl password Ar arg | ||
3075 | .Op Fl twopass | ||
3076 | .Ek | ||
3077 | .El | ||
3078 | .Pp | ||
3079 | The | ||
3080 | .Nm pkcs12 | ||
3081 | command allows PKCS#12 files | ||
3082 | .Pq sometimes referred to as PFX files | ||
3083 | to be created and parsed. | ||
3084 | By default, a PKCS#12 file is parsed; | ||
3085 | a PKCS#12 file can be created by using the | ||
3086 | .Fl export | ||
3087 | option. | ||
3088 | .Pp | ||
3089 | The options for parsing a PKCS12 file are as follows: | ||
3090 | .Bl -tag -width "XXXX" | ||
3091 | .It Xo | ||
3092 | .Fl aes128 | aes192 | aes256 | | ||
3093 | .Fl camellia128 | camellia192 | camellia256 | | ||
3094 | .Fl des | des3 | | ||
3095 | .Fl idea | ||
3096 | .Xc | ||
3097 | Encrypt private keys using AES, CAMELLIA, DES, triple DES | ||
3098 | or the IDEA ciphers, respectively. | ||
3099 | The default is triple DES. | ||
3100 | .It Fl cacerts | ||
3101 | Only output CA certificates | ||
3102 | .Pq not client certificates . | ||
3103 | .It Fl clcerts | ||
3104 | Only output client certificates | ||
3105 | .Pq not CA certificates . | ||
3106 | .It Fl in Ar file | ||
3107 | The input file to read from, | ||
3108 | or standard input if not specified. | ||
3109 | .It Fl info | ||
3110 | Output additional information about the PKCS#12 file structure, | ||
3111 | algorithms used, and iteration counts. | ||
3112 | .It Fl nocerts | ||
3113 | Do not output certificates. | ||
3114 | .It Fl nodes | ||
3115 | Do not encrypt private keys. | ||
3116 | .It Fl nokeys | ||
3117 | Do not output private keys. | ||
3118 | .It Fl nomacver | ||
3119 | Do not attempt to verify the integrity MAC before reading the file. | ||
3120 | .It Fl noout | ||
3121 | Do not output the keys and certificates to the output file | ||
3122 | version of the PKCS#12 file. | ||
3123 | .It Fl out Ar file | ||
3124 | The output file to write to, | ||
3125 | or standard output if not specified. | ||
3126 | .It Fl passin Ar arg | ||
3127 | The key password source. | ||
3128 | .It Fl passout Ar arg | ||
3129 | The output file password source. | ||
3130 | .It Fl twopass | ||
3131 | Prompt for separate integrity and encryption passwords: most software | ||
3132 | always assumes these are the same so this option will render such | ||
3133 | PKCS#12 files unreadable. | ||
3134 | .El | ||
3135 | .Pp | ||
3136 | The options for PKCS12 file creation are as follows: | ||
3137 | .Bl -tag -width "XXXX" | ||
3138 | .It Fl CAfile Ar file | ||
3139 | CA storage as a file. | ||
3140 | .It Fl CApath Ar directory | ||
3141 | CA storage as a directory. | ||
3142 | The directory must be a standard certificate directory: | ||
3143 | that is, a hash of each subject name (using | ||
3144 | .Nm x509 Fl hash ) | ||
3145 | should be linked to each certificate. | ||
3146 | .It Fl caname Ar name | ||
3147 | Specify the | ||
3148 | .Qq friendly name | ||
3149 | for other certificates. | ||
3150 | May be used multiple times to specify names for all certificates | ||
3151 | in the order they appear. | ||
3152 | .It Fl certfile Ar file | ||
3153 | A file to read additional certificates from. | ||
3154 | .It Fl certpbe Ar alg , Fl keypbe Ar alg | ||
3155 | Specify the algorithm used to encrypt the private key and | ||
3156 | certificates to be selected. | ||
3157 | Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name can be used. | ||
3158 | If a cipher name | ||
3159 | (as output by the | ||
3160 | .Cm list-cipher-algorithms | ||
3161 | command) is specified then it | ||
3162 | is used with PKCS#5 v2.0. | ||
3163 | For interoperability reasons it is advisable to only use PKCS#12 algorithms. | ||
3164 | .It Fl chain | ||
3165 | Include the entire certificate chain of the user certificate. | ||
3166 | The standard CA store is used for this search. | ||
3167 | If the search fails, it is considered a fatal error. | ||
3168 | .It Fl descert | ||
3169 | Encrypt the certificate using triple DES; this may render the PKCS#12 | ||
3170 | file unreadable by some | ||
3171 | .Qq export grade | ||
3172 | software. | ||
3173 | By default, the private key is encrypted using triple DES and the | ||
3174 | certificate using 40-bit RC2. | ||
3175 | .It Fl export | ||
3176 | Create a PKCS#12 file (rather than parsing one). | ||
3177 | .It Fl in Ar file | ||
3178 | The input file to read from, | ||
3179 | or standard input if not specified. | ||
3180 | The order doesn't matter but one private key and its corresponding | ||
3181 | certificate should be present. | ||
3182 | If additional certificates are present, they will also be included | ||
3183 | in the PKCS#12 file. | ||
3184 | .It Fl inkey Ar file | ||
3185 | File to read a private key from. | ||
3186 | If not present, a private key must be present in the input file. | ||
3187 | .It Fl keyex | keysig | ||
3188 | Specify whether the private key is to be used for key exchange or just signing. | ||
3189 | Normally, | ||
3190 | .Qq export grade | ||
3191 | software will only allow 512-bit RSA keys to be | ||
3192 | used for encryption purposes, but arbitrary length keys for signing. | ||
3193 | The | ||
3194 | .Fl keysig | ||
3195 | option marks the key for signing only. | ||
3196 | Signing only keys can be used for S/MIME signing, authenticode | ||
3197 | (ActiveX control signing) | ||
3198 | and SSL client authentication. | ||
3199 | .It Fl macalg Ar alg | ||
3200 | Specify the MAC digest algorithm. | ||
3201 | The default is SHA1. | ||
3202 | .It Fl maciter | ||
3203 | Included for compatibility only: | ||
3204 | it used to be needed to use MAC iterations counts | ||
3205 | but they are now used by default. | ||
3206 | .It Fl name Ar name | ||
3207 | Specify the | ||
3208 | .Qq friendly name | ||
3209 | for the certificate and private key. | ||
3210 | This name is typically displayed in list boxes by software importing the file. | ||
3211 | .It Fl nomac | ||
3212 | Don't attempt to provide the MAC integrity. | ||
3213 | .It Fl nomaciter , noiter | ||
3214 | Affect the iteration counts on the MAC and key algorithms. | ||
3215 | .Pp | ||
3216 | To discourage attacks by using large dictionaries of common passwords, | ||
3217 | the algorithm that derives keys from passwords can have an iteration count | ||
3218 | applied to it: this causes a certain part of the algorithm to be repeated | ||
3219 | and slows it down. | ||
3220 | The MAC is used to check the file integrity but since it will normally | ||
3221 | have the same password as the keys and certificates it could also be attacked. | ||
3222 | By default, both MAC and encryption iteration counts are set to 2048; | ||
3223 | using these options the MAC and encryption iteration counts can be set to 1. | ||
3224 | Since this reduces the file security, you should not use these options | ||
3225 | unless you really have to. | ||
3226 | Most software supports both MAC and key iteration counts. | ||
3227 | .It Fl out Ar file | ||
3228 | The output file to write to, | ||
3229 | or standard output if not specified. | ||
3230 | .It Fl passin Ar arg | ||
3231 | The key password source. | ||
3232 | .It Fl passout Ar arg | ||
3233 | The output file password source. | ||
3234 | .It Fl password Ar arg | ||
3235 | With | ||
3236 | .Fl export , | ||
3237 | .Fl password | ||
3238 | is equivalent to | ||
3239 | .Fl passout . | ||
3240 | Otherwise, | ||
3241 | .Fl password | ||
3242 | is equivalent to | ||
3243 | .Fl passin . | ||
3244 | .El | ||
3245 | .Tg pkey | ||
3246 | .Sh PKEY | ||
3247 | .Bl -hang -width "openssl pkey" | ||
3248 | .It Nm openssl pkey | ||
3249 | .Bk -words | ||
3250 | .Op Ar cipher | ||
3251 | .Op Fl in Ar file | ||
3252 | .Op Fl inform Cm der | pem | ||
3253 | .Op Fl noout | ||
3254 | .Op Fl out Ar file | ||
3255 | .Op Fl outform Cm der | pem | ||
3256 | .Op Fl passin Ar arg | ||
3257 | .Op Fl passout Ar arg | ||
3258 | .Op Fl pubin | ||
3259 | .Op Fl pubout | ||
3260 | .Op Fl text | ||
3261 | .Op Fl text_pub | ||
3262 | .Ek | ||
3263 | .El | ||
3264 | .Pp | ||
3265 | The | ||
3266 | .Nm pkey | ||
3267 | command processes public or private keys. | ||
3268 | They can be converted between various forms | ||
3269 | and their components printed out. | ||
3270 | .Pp | ||
3271 | The options are as follows: | ||
3272 | .Bl -tag -width Ds | ||
3273 | .It Ar cipher | ||
3274 | Encrypt the private key with the specified cipher. | ||
3275 | Any algorithm name accepted by | ||
3276 | .Xr EVP_get_cipherbyname 3 | ||
3277 | is acceptable, such as | ||
3278 | .Cm des3 . | ||
3279 | .It Fl in Ar file | ||
3280 | The input file to read from, | ||
3281 | or standard input if not specified. | ||
3282 | If the key is encrypted, a pass phrase will be prompted for. | ||
3283 | .It Fl inform Cm der | pem | ||
3284 | The input format. | ||
3285 | .It Fl noout | ||
3286 | Do not output the encoded version of the key. | ||
3287 | .It Fl out Ar file | ||
3288 | The output file to write to, | ||
3289 | or standard output if not specified. | ||
3290 | If any encryption options are set then a pass phrase | ||
3291 | will be prompted for. | ||
3292 | .It Fl outform Cm der | pem | ||
3293 | The output format. | ||
3294 | .It Fl passin Ar arg | ||
3295 | The key password source. | ||
3296 | .It Fl passout Ar arg | ||
3297 | The output file password source. | ||
3298 | .It Fl pubin | ||
3299 | Read in a public key, not a private key. | ||
3300 | .It Fl pubout | ||
3301 | Output a public key, not a private key. | ||
3302 | Automatically set if the input is a public key. | ||
3303 | .It Fl text | ||
3304 | Print the public/private key in plain text. | ||
3305 | .It Fl text_pub | ||
3306 | Print out only public key components | ||
3307 | even if a private key is being processed. | ||
3308 | .El | ||
3309 | .Tg pkeyparam | ||
3310 | .Sh PKEYPARAM | ||
3311 | .Cm openssl pkeyparam | ||
3312 | .Op Fl in Ar file | ||
3313 | .Op Fl noout | ||
3314 | .Op Fl out Ar file | ||
3315 | .Op Fl text | ||
3316 | .Pp | ||
3317 | The | ||
3318 | .Nm pkeyparam | ||
3319 | command processes public or private keys. | ||
3320 | The key type is determined by the PEM headers. | ||
3321 | .Pp | ||
3322 | The options are as follows: | ||
3323 | .Bl -tag -width Ds | ||
3324 | .It Fl in Ar file | ||
3325 | The input file to read from, | ||
3326 | or standard input if not specified. | ||
3327 | .It Fl noout | ||
3328 | Do not output the encoded version of the parameters. | ||
3329 | .It Fl out Ar file | ||
3330 | The output file to write to, | ||
3331 | or standard output if not specified. | ||
3332 | .It Fl text | ||
3333 | Print the parameters in plain text. | ||
3334 | .El | ||
3335 | .Tg pkeyutl | ||
3336 | .Sh PKEYUTL | ||
3337 | .Bl -hang -width "openssl pkeyutl" | ||
3338 | .It Nm openssl pkeyutl | ||
3339 | .Bk -words | ||
3340 | .Op Fl asn1parse | ||
3341 | .Op Fl certin | ||
3342 | .Op Fl decrypt | ||
3343 | .Op Fl derive | ||
3344 | .Op Fl encrypt | ||
3345 | .Op Fl hexdump | ||
3346 | .Op Fl in Ar file | ||
3347 | .Op Fl inkey Ar file | ||
3348 | .Op Fl keyform Cm der | pem | ||
3349 | .Op Fl out Ar file | ||
3350 | .Op Fl passin Ar arg | ||
3351 | .Op Fl peerform Cm der | pem | ||
3352 | .Op Fl peerkey Ar file | ||
3353 | .Op Fl pkeyopt Ar opt : Ns Ar value | ||
3354 | .Op Fl pubin | ||
3355 | .Op Fl rev | ||
3356 | .Op Fl sigfile Ar file | ||
3357 | .Op Fl sign | ||
3358 | .Op Fl verify | ||
3359 | .Op Fl verifyrecover | ||
3360 | .Ek | ||
3361 | .El | ||
3362 | .Pp | ||
3363 | The | ||
3364 | .Nm pkeyutl | ||
3365 | command can be used to perform public key operations using | ||
3366 | any supported algorithm. | ||
3367 | .Pp | ||
3368 | The options are as follows: | ||
3369 | .Bl -tag -width Ds | ||
3370 | .It Fl asn1parse | ||
3371 | ASN.1 parse the output data. | ||
3372 | This is useful when combined with the | ||
3373 | .Fl verifyrecover | ||
3374 | option when an ASN.1 structure is signed. | ||
3375 | .It Fl certin | ||
3376 | The input is a certificate containing a public key. | ||
3377 | .It Fl decrypt | ||
3378 | Decrypt the input data using a private key. | ||
3379 | .It Fl derive | ||
3380 | Derive a shared secret using the peer key. | ||
3381 | .It Fl encrypt | ||
3382 | Encrypt the input data using a public key. | ||
3383 | .It Fl hexdump | ||
3384 | Hex dump the output data. | ||
3385 | .It Fl in Ar file | ||
3386 | The input file to read from, | ||
3387 | or standard input if not specified. | ||
3388 | .It Fl inkey Ar file | ||
3389 | The input key file. | ||
3390 | By default it should be a private key. | ||
3391 | .It Fl keyform Cm der | pem | ||
3392 | The key format. | ||
3393 | .It Fl out Ar file | ||
3394 | The output file to write to, | ||
3395 | or standard output if not specified. | ||
3396 | .It Fl passin Ar arg | ||
3397 | The key password source. | ||
3398 | .It Fl peerform Cm der | pem | ||
3399 | The peer key format. | ||
3400 | .It Fl peerkey Ar file | ||
3401 | The peer key file, used by key derivation (agreement) operations. | ||
3402 | .It Fl pkeyopt Ar opt : Ns Ar value | ||
3403 | Set the public key algorithm option | ||
3404 | .Ar opt | ||
3405 | to | ||
3406 | .Ar value . | ||
3407 | Unless otherwise mentioned, all algorithms support the format | ||
3408 | .Ar digest : Ns Ar alg , | ||
3409 | which specifies the digest to use | ||
3410 | for sign, verify, and verifyrecover operations. | ||
3411 | The value | ||
3412 | .Ar alg | ||
3413 | should represent a digest name as used in the | ||
3414 | .Xr EVP_get_digestbyname 3 | ||
3415 | function. | ||
3416 | .Pp | ||
3417 | The RSA algorithm supports the | ||
3418 | encrypt, decrypt, sign, verify, and verifyrecover operations in general. | ||
3419 | Some padding modes only support some of these | ||
3420 | operations however. | ||
3421 | .Bl -tag -width Ds | ||
3422 | .It rsa_padding_mode : Ns Ar mode | ||
3423 | This sets the RSA padding mode. | ||
3424 | Acceptable values for | ||
3425 | .Ar mode | ||
3426 | are | ||
3427 | .Cm pkcs1 | ||
3428 | for PKCS#1 padding; | ||
3429 | .Cm none | ||
3430 | for no padding; | ||
3431 | .Cm oaep | ||
3432 | for OAEP mode; | ||
3433 | .Cm x931 | ||
3434 | for X9.31 mode; | ||
3435 | and | ||
3436 | .Cm pss | ||
3437 | for PSS. | ||
3438 | .Pp | ||
3439 | In PKCS#1 padding if the message digest is not set then the supplied data is | ||
3440 | signed or verified directly instead of using a DigestInfo structure. | ||
3441 | If a digest is set then a DigestInfo | ||
3442 | structure is used and its length | ||
3443 | must correspond to the digest type. | ||
3444 | For oeap mode only encryption and decryption is supported. | ||
3445 | For x931 if the digest type is set it is used to format the block data; | ||
3446 | otherwise the first byte is used to specify the X9.31 digest ID. | ||
3447 | Sign, verify, and verifyrecover can be performed in this mode. | ||
3448 | For pss mode only sign and verify are supported and the digest type must be | ||
3449 | specified. | ||
3450 | .It rsa_pss_saltlen : Ns Ar len | ||
3451 | For pss | ||
3452 | mode only this option specifies the salt length. | ||
3453 | Two special values are supported: | ||
3454 | -1 sets the salt length to the digest length. | ||
3455 | When signing, -2 sets the salt length to the maximum permissible value. | ||
3456 | When verifying, -2 causes the salt length to be automatically determined | ||
3457 | based on the PSS block structure. | ||
3458 | .El | ||
3459 | .Pp | ||
3460 | The DSA algorithm supports the sign and verify operations. | ||
3461 | Currently there are no additional options other than | ||
3462 | .Ar digest . | ||
3463 | Only the SHA1 digest can be used and this digest is assumed by default. | ||
3464 | .Pp | ||
3465 | The DH algorithm supports the derive operation | ||
3466 | and no additional options. | ||
3467 | .Pp | ||
3468 | The EC algorithm supports the sign, verify, and derive operations. | ||
3469 | The sign and verify operations use ECDSA and derive uses ECDH. | ||
3470 | Currently there are no additional options other than | ||
3471 | .Ar digest . | ||
3472 | Only the SHA1 digest can be used and this digest is assumed by default. | ||
3473 | .It Fl pubin | ||
3474 | The input file is a public key. | ||
3475 | .It Fl rev | ||
3476 | Reverse the order of the input buffer. | ||
3477 | .It Fl sigfile Ar file | ||
3478 | Signature file (verify operation only). | ||
3479 | .It Fl sign | ||
3480 | Sign the input data and output the signed result. | ||
3481 | This requires a private key. | ||
3482 | .It Fl verify | ||
3483 | Verify the input data against the signature file and indicate if the | ||
3484 | verification succeeded or failed. | ||
3485 | .It Fl verifyrecover | ||
3486 | Verify the input data and output the recovered data. | ||
3487 | .El | ||
3488 | .Tg prime | ||
3489 | .Sh PRIME | ||
3490 | .Cm openssl prime | ||
3491 | .Op Fl bits Ar n | ||
3492 | .Op Fl checks Ar n | ||
3493 | .Op Fl generate | ||
3494 | .Op Fl hex | ||
3495 | .Op Fl safe | ||
3496 | .Ar p | ||
3497 | .Pp | ||
3498 | The | ||
3499 | .Nm prime | ||
3500 | command is used to generate prime numbers, | ||
3501 | or to check numbers for primality. | ||
3502 | Results are probabilistic: | ||
3503 | they have an exceedingly high likelihood of being correct, | ||
3504 | but are not guaranteed. | ||
3505 | .Pp | ||
3506 | The options are as follows: | ||
3507 | .Bl -tag -width Ds | ||
3508 | .It Fl bits Ar n | ||
3509 | Specify the number of bits in the generated prime number. | ||
3510 | Must be used in conjunction with | ||
3511 | .Fl generate . | ||
3512 | .It Fl checks Ar n | ||
3513 | Perform a Miller-Rabin probabilistic primality test with | ||
3514 | .Ar n | ||
3515 | iterations. | ||
3516 | The default is 20. | ||
3517 | .It Fl generate | ||
3518 | Generate a pseudo-random prime number. | ||
3519 | Must be used in conjunction with | ||
3520 | .Fl bits . | ||
3521 | .It Fl hex | ||
3522 | Output in hex format. | ||
3523 | .It Fl safe | ||
3524 | Generate only | ||
3525 | .Qq safe | ||
3526 | prime numbers | ||
3527 | (i.e. a prime p so that (p-1)/2 is also prime). | ||
3528 | .It Ar p | ||
3529 | Test if number | ||
3530 | .Ar p | ||
3531 | is prime. | ||
3532 | .El | ||
3533 | .Tg rand | ||
3534 | .Sh RAND | ||
3535 | .Bl -hang -width "openssl rand" | ||
3536 | .It Nm openssl rand | ||
3537 | .Bk -words | ||
3538 | .Op Fl base64 | ||
3539 | .Op Fl hex | ||
3540 | .Op Fl out Ar file | ||
3541 | .Ar num | ||
3542 | .Ek | ||
3543 | .El | ||
3544 | .Pp | ||
3545 | The | ||
3546 | .Nm rand | ||
3547 | command outputs | ||
3548 | .Ar num | ||
3549 | pseudo-random bytes. | ||
3550 | .Pp | ||
3551 | The options are as follows: | ||
3552 | .Bl -tag -width Ds | ||
3553 | .It Fl base64 | ||
3554 | Perform base64 encoding on the output. | ||
3555 | .It Fl hex | ||
3556 | Specify hexadecimal output. | ||
3557 | .It Fl out Ar file | ||
3558 | The output file to write to, | ||
3559 | or standard output if not specified. | ||
3560 | .El | ||
3561 | .Tg req | ||
3562 | .Sh REQ | ||
3563 | .Bl -hang -width "openssl req" | ||
3564 | .It Nm openssl req | ||
3565 | .Bk -words | ||
3566 | .Op Fl addext Ar ext | ||
3567 | .Op Fl batch | ||
3568 | .Op Fl config Ar file | ||
3569 | .Op Fl days Ar n | ||
3570 | .Op Fl extensions Ar section | ||
3571 | .Op Fl in Ar file | ||
3572 | .Op Fl inform Cm der | pem | ||
3573 | .Op Fl key Ar keyfile | ||
3574 | .Op Fl keyform Cm der | pem | ||
3575 | .Op Fl keyout Ar file | ||
3576 | .Op Fl md4 | md5 | sha1 | ||
3577 | .Op Fl modulus | ||
3578 | .Op Fl multivalue-rdn | ||
3579 | .Op Fl nameopt Ar option | ||
3580 | .Op Fl new | ||
3581 | .Op Fl newhdr | ||
3582 | .Op Fl newkey Ar arg | ||
3583 | .Op Fl nodes | ||
3584 | .Op Fl noout | ||
3585 | .Op Fl out Ar file | ||
3586 | .Op Fl outform Cm der | pem | ||
3587 | .Op Fl passin Ar arg | ||
3588 | .Op Fl passout Ar arg | ||
3589 | .Op Fl pkeyopt Ar opt:value | ||
3590 | .Op Fl pubkey | ||
3591 | .Op Fl reqexts Ar section | ||
3592 | .Op Fl reqopt Ar option | ||
3593 | .Op Fl set_serial Ar n | ||
3594 | .Op Fl sigopt Ar nm:v | ||
3595 | .Op Fl subj Ar arg | ||
3596 | .Op Fl subject | ||
3597 | .Op Fl text | ||
3598 | .Op Fl utf8 | ||
3599 | .Op Fl verbose | ||
3600 | .Op Fl verify | ||
3601 | .Op Fl x509 | ||
3602 | .Ek | ||
3603 | .El | ||
3604 | .Pp | ||
3605 | The | ||
3606 | .Nm req | ||
3607 | command primarily creates and processes certificate requests | ||
3608 | in PKCS#10 format. | ||
3609 | It can additionally create self-signed certificates, | ||
3610 | for use as root CAs, for example. | ||
3611 | .Pp | ||
3612 | The options are as follows: | ||
3613 | .Bl -tag -width Ds | ||
3614 | .It Fl addext Ar ext | ||
3615 | Add a specific extension to the certificate (if the | ||
3616 | .Fl x509 | ||
3617 | option is present) or certificate request. | ||
3618 | The argument must have the form of a key=value pair as it would appear in a | ||
3619 | config file. | ||
3620 | This option can be given multiple times. | ||
3621 | .It Fl batch | ||
3622 | Non-interactive mode. | ||
3623 | .It Fl config Ar file | ||
3624 | Specify an alternative configuration file. | ||
3625 | .It Fl days Ar n | ||
3626 | Specify the number of days to certify the certificate for. | ||
3627 | The default is 30 days. | ||
3628 | Used with the | ||
3629 | .Fl x509 | ||
3630 | option. | ||
3631 | .It Fl extensions Ar section , Fl reqexts Ar section | ||
3632 | Specify alternative sections to include certificate | ||
3633 | extensions (with | ||
3634 | .Fl x509 ) | ||
3635 | or certificate request extensions, | ||
3636 | allowing several different sections to be used in the same configuration file. | ||
3637 | .It Fl in Ar file | ||
3638 | The input file to read a request from, | ||
3639 | or standard input if not specified. | ||
3640 | A request is only read if the creation options | ||
3641 | .Fl new | ||
3642 | and | ||
3643 | .Fl newkey | ||
3644 | are not specified. | ||
3645 | .It Fl inform Cm der | pem | ||
3646 | The input format. | ||
3647 | .It Fl key Ar keyfile | ||
3648 | The file to read the private key from. | ||
3649 | It also accepts PKCS#8 format private keys for PEM format files. | ||
3650 | .It Fl keyform Cm der | pem | ||
3651 | The format of the private key file specified in the | ||
3652 | .Fl key | ||
3653 | argument. | ||
3654 | The default is | ||
3655 | .Cm pem . | ||
3656 | .It Fl keyout Ar file | ||
3657 | The file to write the newly created private key to. | ||
3658 | If this option is not specified, | ||
3659 | the filename present in the configuration file is used. | ||
3660 | .It Fl md5 | sha1 | sha256 | ||
3661 | The message digest to sign the request with. | ||
3662 | This overrides the digest algorithm specified in the configuration file. | ||
3663 | .Pp | ||
3664 | Some public key algorithms may override this choice. | ||
3665 | For instance, DSA signatures always use SHA1. | ||
3666 | .It Fl modulus | ||
3667 | Print the value of the modulus of the public key contained in the request. | ||
3668 | .It Fl multivalue-rdn | ||
3669 | This option causes the | ||
3670 | .Fl subj | ||
3671 | argument to be interpreted with full support for multivalued RDNs, | ||
3672 | for example | ||
3673 | .Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" . | ||
3674 | If | ||
3675 | .Fl multivalue-rdn | ||
3676 | is not used, the UID value is set to | ||
3677 | .Qq "123456+CN=John Doe" . | ||
3678 | .It Fl nameopt Ar option , Fl reqopt Ar option | ||
3679 | Determine how the subject or issuer names are displayed. | ||
3680 | .Ar option | ||
3681 | can be a single option or multiple options separated by commas. | ||
3682 | Alternatively, these options may be used more than once to set multiple options. | ||
3683 | See the | ||
3684 | .Sx X509 | ||
3685 | section below for details. | ||
3686 | .It Fl new | ||
3687 | Generate a new certificate request. | ||
3688 | The user is prompted for the relevant field values. | ||
3689 | The actual fields prompted for and their maximum and minimum sizes | ||
3690 | are specified in the configuration file and any requested extensions. | ||
3691 | .Pp | ||
3692 | If the | ||
3693 | .Fl key | ||
3694 | option is not used, it will generate a new RSA private | ||
3695 | key using information specified in the configuration file. | ||
3696 | .It Fl newhdr | ||
3697 | Add the word NEW to the PEM file header and footer lines | ||
3698 | on the outputted request. | ||
3699 | Some software and CAs need this. | ||
3700 | .It Fl newkey Ar arg | ||
3701 | Create a new certificate request and a new private key. | ||
3702 | The argument takes one of several forms. | ||
3703 | .Pp | ||
3704 | .No rsa : Ns Ar nbits | ||
3705 | generates an RSA key | ||
3706 | .Ar nbits | ||
3707 | in size. | ||
3708 | If | ||
3709 | .Ar nbits | ||
3710 | is omitted, | ||
3711 | the default key size is used. | ||
3712 | .Pp | ||
3713 | .No dsa : Ns Ar file | ||
3714 | generates a DSA key using the parameters in | ||
3715 | .Ar file . | ||
3716 | .Pp | ||
3717 | .No param : Ns Ar file | ||
3718 | generates a key using the parameters or certificate in | ||
3719 | .Ar file . | ||
3720 | .Pp | ||
3721 | All other algorithms support the form | ||
3722 | .Ar algorithm : Ns Ar file , | ||
3723 | where file may be an algorithm parameter file, | ||
3724 | created by the | ||
3725 | .Cm genpkey -genparam | ||
3726 | command or an X.509 certificate for a key with appropriate algorithm. | ||
3727 | .Ar file | ||
3728 | can be omitted, | ||
3729 | in which case any parameters can be specified via the | ||
3730 | .Fl pkeyopt | ||
3731 | option. | ||
3732 | .It Fl nodes | ||
3733 | Do not encrypt the private key. | ||
3734 | .It Fl noout | ||
3735 | Do not output the encoded version of the request. | ||
3736 | .It Fl out Ar file | ||
3737 | The output file to write to, | ||
3738 | or standard output if not specified. | ||
3739 | .It Fl outform Cm der | pem | ||
3740 | The output format. | ||
3741 | .It Fl passin Ar arg | ||
3742 | The key password source. | ||
3743 | .It Fl passout Ar arg | ||
3744 | The output file password source. | ||
3745 | .It Fl pkeyopt Ar opt:value | ||
3746 | Set the public key algorithm option | ||
3747 | .Ar opt | ||
3748 | to | ||
3749 | .Ar value . | ||
3750 | .It Fl pubkey | ||
3751 | Output the public key. | ||
3752 | .It Fl reqopt Ar option | ||
3753 | Customise the output format used with | ||
3754 | .Fl text . | ||
3755 | The | ||
3756 | .Ar option | ||
3757 | argument can be a single option or multiple options separated by commas. | ||
3758 | See also the discussion of | ||
3759 | .Fl certopt | ||
3760 | in the | ||
3761 | .Nm x509 | ||
3762 | command. | ||
3763 | .It Fl set_serial Ar n | ||
3764 | Serial number to use when outputting a self-signed certificate. | ||
3765 | This may be specified as a decimal value or a hex value if preceded by | ||
3766 | .Sq 0x . | ||
3767 | It is possible to use negative serial numbers but this is not recommended. | ||
3768 | .It Fl sigopt Ar nm:v | ||
3769 | Pass options to the signature algorithm during sign operation. | ||
3770 | The names and values of these options are algorithm-specific. | ||
3771 | .It Fl subj Ar arg | ||
3772 | Replaces the subject field of an input request | ||
3773 | with the specified data and output the modified request. | ||
3774 | .Ar arg | ||
3775 | must be formatted as /type0=value0/type1=value1/type2=...; | ||
3776 | characters may be escaped by | ||
3777 | .Sq \e | ||
3778 | (backslash); | ||
3779 | no spaces are skipped. | ||
3780 | .It Fl subject | ||
3781 | Print the request subject (or certificate subject if | ||
3782 | .Fl x509 | ||
3783 | is specified). | ||
3784 | .It Fl text | ||
3785 | Print the certificate request in plain text. | ||
3786 | .It Fl utf8 | ||
3787 | Interpret field values as UTF8 strings, not ASCII. | ||
3788 | .It Fl verbose | ||
3789 | Print extra details about the operations being performed. | ||
3790 | .It Fl verify | ||
3791 | Verify the signature on the request. | ||
3792 | .It Fl x509 | ||
3793 | Output a self-signed certificate instead of a certificate request. | ||
3794 | This is typically used to generate a test certificate or a self-signed root CA. | ||
3795 | The extensions added to the certificate (if any) | ||
3796 | are specified in the configuration file. | ||
3797 | Unless specified using the | ||
3798 | .Fl set_serial | ||
3799 | option, 0 is used for the serial number. | ||
3800 | .El | ||
3801 | .Pp | ||
3802 | The configuration options are specified in the | ||
3803 | .Qq req | ||
3804 | section of the configuration file. | ||
3805 | The options available are as follows: | ||
3806 | .Bl -tag -width "XXXX" | ||
3807 | .It Cm attributes | ||
3808 | The section containing any request attributes: its format | ||
3809 | is the same as | ||
3810 | .Cm distinguished_name . | ||
3811 | Typically these may contain the challengePassword or unstructuredName types. | ||
3812 | They are currently ignored by the | ||
3813 | .Nm openssl | ||
3814 | request signing utilities, but some CAs might want them. | ||
3815 | .It Cm default_bits | ||
3816 | The default key size, in bits. | ||
3817 | The default is 2048. | ||
3818 | It is used if the | ||
3819 | .Fl new | ||
3820 | option is used and can be overridden by using the | ||
3821 | .Fl newkey | ||
3822 | option. | ||
3823 | .It Cm default_keyfile | ||
3824 | The default file to write a private key to, | ||
3825 | or standard output if not specified. | ||
3826 | It can be overridden by the | ||
3827 | .Fl keyout | ||
3828 | option. | ||
3829 | .It Cm default_md | ||
3830 | The digest algorithm to use. | ||
3831 | Possible values include | ||
3832 | .Cm md5 , | ||
3833 | .Cm sha1 | ||
3834 | and | ||
3835 | .Cm sha256 | ||
3836 | (the default). | ||
3837 | It can be overridden on the command line. | ||
3838 | .It Cm distinguished_name | ||
3839 | The section containing the distinguished name fields to | ||
3840 | prompt for when generating a certificate or certificate request. | ||
3841 | The format is described below. | ||
3842 | .It Cm encrypt_key | ||
3843 | If set to | ||
3844 | .Qq no | ||
3845 | and a private key is generated, it is not encrypted. | ||
3846 | It is equivalent to the | ||
3847 | .Fl nodes | ||
3848 | option. | ||
3849 | For compatibility, | ||
3850 | .Cm encrypt_rsa_key | ||
3851 | is an equivalent option. | ||
3852 | .It Cm input_password | output_password | ||
3853 | The passwords for the input private key file (if present) | ||
3854 | and the output private key file (if one will be created). | ||
3855 | The command line options | ||
3856 | .Fl passin | ||
3857 | and | ||
3858 | .Fl passout | ||
3859 | override the configuration file values. | ||
3860 | .It Cm oid_file | ||
3861 | A file containing additional OBJECT IDENTIFIERS. | ||
3862 | Each line of the file should consist of the numerical form of the | ||
3863 | object identifier, followed by whitespace, then the short name followed | ||
3864 | by whitespace and finally the long name. | ||
3865 | .It Cm oid_section | ||
3866 | Specify a section in the configuration file containing extra | ||
3867 | object identifiers. | ||
3868 | Each line should consist of the short name of the | ||
3869 | object identifier followed by | ||
3870 | .Sq = | ||
3871 | and the numerical form. | ||
3872 | The short and long names are the same when this option is used. | ||
3873 | .It Cm prompt | ||
3874 | If set to | ||
3875 | .Qq no , | ||
3876 | it disables prompting of certificate fields | ||
3877 | and just takes values from the config file directly. | ||
3878 | It also changes the expected format of the | ||
3879 | .Cm distinguished_name | ||
3880 | and | ||
3881 | .Cm attributes | ||
3882 | sections. | ||
3883 | .It Cm req_extensions | ||
3884 | The configuration file section containing a list of | ||
3885 | extensions to add to the certificate request. | ||
3886 | It can be overridden by the | ||
3887 | .Fl reqexts | ||
3888 | option. | ||
3889 | .It Cm string_mask | ||
3890 | Limit the string types for encoding certain fields. | ||
3891 | The following values may be used, limiting strings to the indicated types: | ||
3892 | .Bl -tag -width "MASK:number" | ||
3893 | .It Cm utf8only | ||
3894 | UTF8String. | ||
3895 | This is the default, as recommended by PKIX in RFC 2459. | ||
3896 | .It Cm default | ||
3897 | PrintableString, IA5String, T61String, BMPString, UTF8String. | ||
3898 | .It Cm pkix | ||
3899 | PrintableString, IA5String, BMPString, UTF8String. | ||
3900 | Inspired by the PKIX recommendation in RFC 2459 for certificates | ||
3901 | generated before 2004, but differs by also permitting IA5String. | ||
3902 | .It Cm nombstr | ||
3903 | PrintableString, IA5String, T61String, UniversalString. | ||
3904 | A workaround for some ancient software that had problems | ||
3905 | with the variable-sized BMPString and UTF8String types. | ||
3906 | .It Cm MASK : Ns Ar number | ||
3907 | An explicit bitmask of permitted types, where | ||
3908 | .Ar number | ||
3909 | is a C-style hex, decimal, or octal number that's a bit-wise OR of | ||
3910 | .Dv B_ASN1_* | ||
3911 | values from | ||
3912 | .In openssl/asn1.h . | ||
3913 | .El | ||
3914 | .It Cm utf8 | ||
3915 | If set to | ||
3916 | .Qq yes , | ||
3917 | field values are interpreted as UTF8 strings. | ||
3918 | .It Cm x509_extensions | ||
3919 | The configuration file section containing a list of | ||
3920 | extensions to add to a certificate generated when the | ||
3921 | .Fl x509 | ||
3922 | switch is used. | ||
3923 | It can be overridden by the | ||
3924 | .Fl extensions | ||
3925 | command line switch. | ||
3926 | .El | ||
3927 | .Pp | ||
3928 | There are two separate formats for the distinguished name and attribute | ||
3929 | sections. | ||
3930 | If the | ||
3931 | .Fl prompt | ||
3932 | option is set to | ||
3933 | .Qq no , | ||
3934 | then these sections just consist of field names and values. | ||
3935 | If the | ||
3936 | .Fl prompt | ||
3937 | option is absent or not set to | ||
3938 | .Qq no , | ||
3939 | then the file contains field prompting information of the form: | ||
3940 | .Bd -unfilled -offset indent | ||
3941 | fieldName="prompt" | ||
3942 | fieldName_default="default field value" | ||
3943 | fieldName_min= 2 | ||
3944 | fieldName_max= 4 | ||
3945 | .Ed | ||
3946 | .Pp | ||
3947 | .Qq fieldName | ||
3948 | is the field name being used, for example | ||
3949 | .Cm commonName | ||
3950 | (or CN). | ||
3951 | The | ||
3952 | .Qq prompt | ||
3953 | string is used to ask the user to enter the relevant details. | ||
3954 | If the user enters nothing, the default value is used; | ||
3955 | if no default value is present, the field is omitted. | ||
3956 | A field can still be omitted if a default value is present, | ||
3957 | if the user just enters the | ||
3958 | .Sq \&. | ||
3959 | character. | ||
3960 | .Pp | ||
3961 | The number of characters entered must be between the | ||
3962 | fieldName_min and fieldName_max limits: | ||
3963 | there may be additional restrictions based on the field being used | ||
3964 | (for example | ||
3965 | .Cm countryName | ||
3966 | can only ever be two characters long and must fit in a | ||
3967 | .Cm PrintableString ) . | ||
3968 | .Pp | ||
3969 | Some fields (such as | ||
3970 | .Cm organizationName ) | ||
3971 | can be used more than once in a DN. | ||
3972 | This presents a problem because configuration files will | ||
3973 | not recognize the same name occurring twice. | ||
3974 | To avoid this problem, if the | ||
3975 | .Cm fieldName | ||
3976 | contains some characters followed by a full stop, they will be ignored. | ||
3977 | So, for example, a second | ||
3978 | .Cm organizationName | ||
3979 | can be input by calling it | ||
3980 | .Qq 1.organizationName . | ||
3981 | .Pp | ||
3982 | The actual permitted field names are any object identifier short or | ||
3983 | long names. | ||
3984 | These are compiled into | ||
3985 | .Nm openssl | ||
3986 | and include the usual values such as | ||
3987 | .Cm commonName , countryName , localityName , organizationName , | ||
3988 | .Cm organizationalUnitName , stateOrProvinceName . | ||
3989 | Additionally, | ||
3990 | .Cm emailAddress | ||
3991 | is included as well as | ||
3992 | .Cm name , surname , givenName , initials | ||
3993 | and | ||
3994 | .Cm dnQualifier . | ||
3995 | .Pp | ||
3996 | Additional object identifiers can be defined with the | ||
3997 | .Cm oid_file | ||
3998 | or | ||
3999 | .Cm oid_section | ||
4000 | options in the configuration file. | ||
4001 | Any additional fields will be treated as though they were a | ||
4002 | .Cm DirectoryString . | ||
4003 | .Tg rsa | ||
4004 | .Sh RSA | ||
4005 | .Bl -hang -width "openssl rsa" | ||
4006 | .It Nm openssl rsa | ||
4007 | .Bk -words | ||
4008 | .Op Fl aes128 | aes192 | aes256 | des | des3 | ||
4009 | .Op Fl check | ||
4010 | .Op Fl in Ar file | ||
4011 | .Op Fl inform Cm der | net | pem | pvk | ||
4012 | .Op Fl modulus | ||
4013 | .Op Fl noout | ||
4014 | .Op Fl out Ar file | ||
4015 | .Op Fl outform Cm der | net | pem | pvk | ||
4016 | .Op Fl passin Ar arg | ||
4017 | .Op Fl passout Ar arg | ||
4018 | .Op Fl pubin | ||
4019 | .Op Fl pubout | ||
4020 | .Op Fl pvk-none | pvk-strong | pvk-weak | ||
4021 | .Op Fl RSAPublicKey_in | ||
4022 | .Op Fl RSAPublicKey_out | ||
4023 | .Op Fl text | ||
4024 | .Ek | ||
4025 | .El | ||
4026 | .Pp | ||
4027 | The | ||
4028 | .Nm rsa | ||
4029 | command processes RSA keys. | ||
4030 | They can be converted between various forms and their components printed out. | ||
4031 | .Nm rsa | ||
4032 | uses the traditional | ||
4033 | .Nm SSLeay | ||
4034 | compatible format for private key encryption: | ||
4035 | newer applications should use the more secure PKCS#8 format using the | ||
4036 | .Nm pkcs8 | ||
4037 | utility. | ||
4038 | .Pp | ||
4039 | The options are as follows: | ||
4040 | .Bl -tag -width Ds | ||
4041 | .It Fl aes128 | aes192 | aes256 | des | des3 | ||
4042 | Encrypt the private key with the AES, DES, | ||
4043 | or the triple DES ciphers, respectively, before outputting it. | ||
4044 | A pass phrase is prompted for. | ||
4045 | If none of these options are specified, the key is written in plain text. | ||
4046 | This means that using the | ||
4047 | .Nm rsa | ||
4048 | utility to read in an encrypted key with no encryption option can be used | ||
4049 | to remove the pass phrase from a key, or by setting the encryption options | ||
4050 | it can be used to add or change the pass phrase. | ||
4051 | These options can only be used with PEM format output files. | ||
4052 | .It Fl check | ||
4053 | Check the consistency of an RSA private key. | ||
4054 | .It Fl in Ar file | ||
4055 | The input file to read from, | ||
4056 | or standard input if not specified. | ||
4057 | If the key is encrypted, a pass phrase will be prompted for. | ||
4058 | .It Fl inform Cm der | net | pem | pvk | ||
4059 | The input format. | ||
4060 | .It Fl noout | ||
4061 | Do not output the encoded version of the key. | ||
4062 | .It Fl modulus | ||
4063 | Print the value of the modulus of the key. | ||
4064 | .It Fl out Ar file | ||
4065 | The output file to write to, | ||
4066 | or standard output if not specified. | ||
4067 | .It Fl outform Cm der | net | pem | pvk | ||
4068 | The output format. | ||
4069 | .It Fl passin Ar arg | ||
4070 | The key password source. | ||
4071 | .It Fl passout Ar arg | ||
4072 | The output file password source. | ||
4073 | .It Fl pubin | ||
4074 | Read in a public key, | ||
4075 | not a private key. | ||
4076 | .It Fl pubout | ||
4077 | Output a public key, | ||
4078 | not a private key. | ||
4079 | Automatically set if the input is a public key. | ||
4080 | .It Xo | ||
4081 | .Fl pvk-none | pvk-strong | pvk-weak | ||
4082 | .Xc | ||
4083 | Enable or disable PVK encoding. | ||
4084 | The default is | ||
4085 | .Fl pvk-strong . | ||
4086 | .It Fl RSAPublicKey_in , RSAPublicKey_out | ||
4087 | Same as | ||
4088 | .Fl pubin | ||
4089 | and | ||
4090 | .Fl pubout | ||
4091 | except | ||
4092 | .Cm RSAPublicKey | ||
4093 | format is used instead. | ||
4094 | .It Fl text | ||
4095 | Print the public/private key components in plain text. | ||
4096 | .El | ||
4097 | .Tg rsautl | ||
4098 | .Sh RSAUTL | ||
4099 | .Bl -hang -width "openssl rsautl" | ||
4100 | .It Nm openssl rsautl | ||
4101 | .Bk -words | ||
4102 | .Op Fl asn1parse | ||
4103 | .Op Fl certin | ||
4104 | .Op Fl decrypt | ||
4105 | .Op Fl encrypt | ||
4106 | .Op Fl hexdump | ||
4107 | .Op Fl in Ar file | ||
4108 | .Op Fl inkey Ar file | ||
4109 | .Op Fl keyform Cm der | pem | ||
4110 | .Op Fl oaep | pkcs | raw | x931 | ||
4111 | .Op Fl out Ar file | ||
4112 | .Op Fl passin Ar arg | ||
4113 | .Op Fl pubin | ||
4114 | .Op Fl rev | ||
4115 | .Op Fl sign | ||
4116 | .Op Fl verify | ||
4117 | .Ek | ||
4118 | .El | ||
4119 | .Pp | ||
4120 | The | ||
4121 | .Nm rsautl | ||
4122 | command can be used to sign, verify, encrypt and decrypt | ||
4123 | data using the RSA algorithm. | ||
4124 | .Pp | ||
4125 | The options are as follows: | ||
4126 | .Bl -tag -width Ds | ||
4127 | .It Fl asn1parse | ||
4128 | Asn1parse the output data; this is useful when combined with the | ||
4129 | .Fl verify | ||
4130 | option. | ||
4131 | .It Fl certin | ||
4132 | The input is a certificate containing an RSA public key. | ||
4133 | .It Fl decrypt | ||
4134 | Decrypt the input data using an RSA private key. | ||
4135 | .It Fl encrypt | ||
4136 | Encrypt the input data using an RSA public key. | ||
4137 | .It Fl hexdump | ||
4138 | Hex dump the output data. | ||
4139 | .It Fl in Ar file | ||
4140 | The input to read from, | ||
4141 | or standard input if not specified. | ||
4142 | .It Fl inkey Ar file | ||
4143 | The input key file; by default an RSA private key. | ||
4144 | .It Fl keyform Cm der | pem | ||
4145 | The private key format. | ||
4146 | The default is | ||
4147 | .Cm pem . | ||
4148 | .It Fl oaep | pkcs | raw | x931 | ||
4149 | The padding to use: | ||
4150 | PKCS#1 OAEP, PKCS#1 v1.5 (the default), no padding, or ANSI X9.31, | ||
4151 | respectively. | ||
4152 | For signatures, only | ||
4153 | .Fl pkcs | ||
4154 | and | ||
4155 | .Fl raw | ||
4156 | can be used. | ||
4157 | .It Fl out Ar file | ||
4158 | The output file to write to, | ||
4159 | or standard output if not specified. | ||
4160 | .It Fl passin Ar arg | ||
4161 | The key password source. | ||
4162 | .It Fl pubin | ||
4163 | The input file is an RSA public key. | ||
4164 | .It Fl rev | ||
4165 | Reverse the order of the input buffer. | ||
4166 | .It Fl sign | ||
4167 | Sign the input data and output the signed result. | ||
4168 | This requires an RSA private key. | ||
4169 | .It Fl verify | ||
4170 | Verify the input data and output the recovered data. | ||
4171 | .El | ||
4172 | .Tg s_client | ||
4173 | .Sh S_CLIENT | ||
4174 | .Bl -hang -width "openssl s_client" | ||
4175 | .It Nm openssl s_client | ||
4176 | .Bk -words | ||
4177 | .Op Fl 4 | 6 | ||
4178 | .Op Fl alpn Ar protocols | ||
4179 | .Op Fl bugs | ||
4180 | .Op Fl CAfile Ar file | ||
4181 | .Op Fl CApath Ar directory | ||
4182 | .Op Fl cert Ar file | ||
4183 | .Op Fl certform Cm der | pem | ||
4184 | .Op Fl check_ss_sig | ||
4185 | .Op Fl cipher Ar cipherlist | ||
4186 | .Op Fl connect Ar host Ns Op : Ns Ar port | ||
4187 | .Op Fl crl_check | ||
4188 | .Op Fl crl_check_all | ||
4189 | .Op Fl crlf | ||
4190 | .Op Fl debug | ||
4191 | .Op Fl dtls | ||
4192 | .Op Fl dtls1_2 | ||
4193 | .Op Fl extended_crl | ||
4194 | .Op Fl groups Ar list | ||
4195 | .Op Fl host Ar host | ||
4196 | .Op Fl ign_eof | ||
4197 | .Op Fl ignore_critical | ||
4198 | .Op Fl issuer_checks | ||
4199 | .Op Fl key Ar keyfile | ||
4200 | .Op Fl keyform Cm der | pem | ||
4201 | .Op Fl keymatexport Ar label | ||
4202 | .Op Fl keymatexportlen Ar len | ||
4203 | .Op Fl legacy_server_connect | ||
4204 | .Op Fl msg | ||
4205 | .Op Fl mtu Ar mtu | ||
4206 | .Op Fl nbio | ||
4207 | .Op Fl nbio_test | ||
4208 | .Op Fl no_comp | ||
4209 | .Op Fl no_ign_eof | ||
4210 | .Op Fl no_legacy_server_connect | ||
4211 | .Op Fl no_ticket | ||
4212 | .Op Fl no_tls1_2 | ||
4213 | .Op Fl no_tls1_3 | ||
4214 | .Op Fl pass Ar arg | ||
4215 | .Op Fl policy_check | ||
4216 | .Op Fl port Ar port | ||
4217 | .Op Fl prexit | ||
4218 | .Op Fl proxy Ar host : Ns Ar port | ||
4219 | .Op Fl quiet | ||
4220 | .Op Fl reconnect | ||
4221 | .Op Fl servername Ar name | ||
4222 | .Op Fl serverpref | ||
4223 | .Op Fl sess_in Ar file | ||
4224 | .Op Fl sess_out Ar file | ||
4225 | .Op Fl showcerts | ||
4226 | .Op Fl starttls Ar protocol | ||
4227 | .Op Fl state | ||
4228 | .Op Fl status | ||
4229 | .Op Fl timeout | ||
4230 | .Op Fl tls1_2 | ||
4231 | .Op Fl tls1_3 | ||
4232 | .Op Fl tlsextdebug | ||
4233 | .Op Fl use_srtp Ar profiles | ||
4234 | .Op Fl verify Ar depth | ||
4235 | .Op Fl verify_return_error | ||
4236 | .Op Fl x509_strict | ||
4237 | .Op Fl xmpphost Ar host | ||
4238 | .Ek | ||
4239 | .El | ||
4240 | .Pp | ||
4241 | The | ||
4242 | .Nm s_client | ||
4243 | command implements a generic SSL/TLS client which connects | ||
4244 | to a remote host using SSL/TLS. | ||
4245 | .Pp | ||
4246 | If a connection is established with an SSL server, any data received | ||
4247 | from the server is displayed and any key presses will be sent to the | ||
4248 | server. | ||
4249 | When used interactively (which means neither | ||
4250 | .Fl quiet | ||
4251 | nor | ||
4252 | .Fl ign_eof | ||
4253 | have been given), the session will be renegotiated if the line begins with an | ||
4254 | .Cm R ; | ||
4255 | if the line begins with a | ||
4256 | .Cm Q | ||
4257 | or if end of file is reached, the connection will be closed down. | ||
4258 | .Pp | ||
4259 | The options are as follows: | ||
4260 | .Bl -tag -width Ds | ||
4261 | .It Fl 4 | ||
4262 | Attempt connections using IPv4 only. | ||
4263 | .It Fl 6 | ||
4264 | Attempt connections using IPv6 only. | ||
4265 | .It Fl alpn Ar protocols | ||
4266 | Enable the Application-Layer Protocol Negotiation. | ||
4267 | .Ar protocols | ||
4268 | is a comma-separated list of protocol names that the client should advertise | ||
4269 | support for. | ||
4270 | .It Fl bugs | ||
4271 | Enable various workarounds for buggy implementations. | ||
4272 | .It Fl CAfile Ar file | ||
4273 | A | ||
4274 | .Ar file | ||
4275 | containing trusted certificates to use during server authentication | ||
4276 | and to use when attempting to build the client certificate chain. | ||
4277 | .It Fl CApath Ar directory | ||
4278 | The | ||
4279 | .Ar directory | ||
4280 | to use for server certificate verification. | ||
4281 | This directory must be in | ||
4282 | .Qq hash format ; | ||
4283 | see | ||
4284 | .Fl verify | ||
4285 | for more information. | ||
4286 | These are also used when building the client certificate chain. | ||
4287 | .It Fl cert Ar file | ||
4288 | The certificate to use, if one is requested by the server. | ||
4289 | The default is not to use a certificate. | ||
4290 | .It Fl certform Cm der | pem | ||
4291 | The certificate format. | ||
4292 | The default is | ||
4293 | .Cm pem . | ||
4294 | .It Xo | ||
4295 | .Fl check_ss_sig , | ||
4296 | .Fl crl_check , | ||
4297 | .Fl crl_check_all , | ||
4298 | .Fl extended_crl , | ||
4299 | .Fl ignore_critical , | ||
4300 | .Fl issuer_checks , | ||
4301 | .Fl policy_check , | ||
4302 | .Fl x509_strict | ||
4303 | .Xc | ||
4304 | Set various certificate chain validation options. | ||
4305 | See the | ||
4306 | .Nm verify | ||
4307 | command for details. | ||
4308 | .It Fl cipher Ar cipherlist | ||
4309 | Modify the cipher list sent by the client. | ||
4310 | Although the server determines which cipher suite is used, it should take | ||
4311 | the first supported cipher in the list sent by the client. | ||
4312 | See the | ||
4313 | .Nm ciphers | ||
4314 | command for more information. | ||
4315 | .It Fl connect Ar host Ns Op : Ns Ar port | ||
4316 | The | ||
4317 | .Ar host | ||
4318 | and | ||
4319 | .Ar port | ||
4320 | to connect to. | ||
4321 | If not specified, an attempt is made to connect to the local host | ||
4322 | on port 4433. | ||
4323 | Alternatively, the host and port pair may be separated using a forward-slash | ||
4324 | character, | ||
4325 | which is useful for numeric IPv6 addresses. | ||
4326 | .It Fl crlf | ||
4327 | Translate a line feed from the terminal into CR+LF, | ||
4328 | as required by some servers. | ||
4329 | .It Fl debug | ||
4330 | Print extensive debugging information, including a hex dump of all traffic. | ||
4331 | .It Fl dtls | ||
4332 | Permit any version of DTLS. | ||
4333 | .It Fl dtls1_2 | ||
4334 | Permit only DTLS1.2. | ||
4335 | .It Fl groups Ar list | ||
4336 | Set the supported elliptic curve groups to the colon separated | ||
4337 | .Ar list | ||
4338 | of group NIDs or names as documented in | ||
4339 | .Xr SSL_CTX_set1_groups_list 3 . | ||
4340 | .It Fl host Ar host | ||
4341 | The | ||
4342 | .Ar host | ||
4343 | to connect to. | ||
4344 | The default is localhost. | ||
4345 | .It Fl ign_eof | ||
4346 | Inhibit shutting down the connection when end of file is reached in the input. | ||
4347 | .It Fl key Ar keyfile | ||
4348 | The private key to use. | ||
4349 | If not specified, the certificate file will be used. | ||
4350 | .It Fl keyform Cm der | pem | ||
4351 | The private key format. | ||
4352 | The default is | ||
4353 | .Cm pem . | ||
4354 | .It Fl keymatexport Ar label | ||
4355 | Export keying material using label. | ||
4356 | .It Fl keymatexportlen Ar len | ||
4357 | Export len bytes of keying material (default 20). | ||
4358 | .It Fl legacy_server_connect , no_legacy_server_connect | ||
4359 | Allow or disallow initial connection to servers that don't support RI. | ||
4360 | .It Fl msg | ||
4361 | Show all protocol messages with hex dump. | ||
4362 | .It Fl mtu Ar mtu | ||
4363 | Set the link layer MTU. | ||
4364 | .It Fl nbio | ||
4365 | Turn on non-blocking I/O. | ||
4366 | .It Fl nbio_test | ||
4367 | Test non-blocking I/O. | ||
4368 | .It Fl no_ign_eof | ||
4369 | Shut down the connection when end of file is reached in the input. | ||
4370 | Can be used to override the implicit | ||
4371 | .Fl ign_eof | ||
4372 | after | ||
4373 | .Fl quiet . | ||
4374 | .It Fl no_tls1_2 | no_tls1_3 | ||
4375 | Disable the use of TLS1.2 and 1.3, respectively. | ||
4376 | .It Fl no_ticket | ||
4377 | Disable RFC 4507 session ticket support. | ||
4378 | .It Fl pass Ar arg | ||
4379 | The private key password source. | ||
4380 | .It Fl port Ar port | ||
4381 | The | ||
4382 | .Ar port | ||
4383 | to connect to. | ||
4384 | The default is 4433. | ||
4385 | .It Fl prexit | ||
4386 | Print session information when the program exits. | ||
4387 | This will always attempt | ||
4388 | to print out information even if the connection fails. | ||
4389 | Normally, information will only be printed out once if the connection succeeds. | ||
4390 | This option is useful because the cipher in use may be renegotiated | ||
4391 | or the connection may fail because a client certificate is required or is | ||
4392 | requested only after an attempt is made to access a certain URL. | ||
4393 | Note that the output produced by this option is not always accurate | ||
4394 | because a connection might never have been established. | ||
4395 | .It Fl proxy Ar host : Ns Ar port | ||
4396 | Use the HTTP proxy at | ||
4397 | .Ar host | ||
4398 | and | ||
4399 | .Ar port . | ||
4400 | The connection to the proxy is done in cleartext and the | ||
4401 | .Fl connect | ||
4402 | argument is given to the proxy. | ||
4403 | If not specified, localhost is used as final destination. | ||
4404 | After that, switch the connection through the proxy to the destination | ||
4405 | to TLS. | ||
4406 | .It Fl quiet | ||
4407 | Inhibit printing of session and certificate information. | ||
4408 | This implicitly turns on | ||
4409 | .Fl ign_eof | ||
4410 | as well. | ||
4411 | .It Fl reconnect | ||
4412 | Reconnect to the same server 5 times using the same session ID; this can | ||
4413 | be used as a test that session caching is working. | ||
4414 | .It Fl servername Ar name | ||
4415 | Include the TLS Server Name Indication (SNI) extension in the ClientHello | ||
4416 | message, using the specified server | ||
4417 | .Ar name . | ||
4418 | .It Fl showcerts | ||
4419 | Display the whole server certificate chain: normally only the server | ||
4420 | certificate itself is displayed. | ||
4421 | .It Fl serverpref | ||
4422 | Use the server's cipher preferences. | ||
4423 | .It Fl sess_in Ar file | ||
4424 | Load TLS session from file. | ||
4425 | The client will attempt to resume a connection from this session. | ||
4426 | .It Fl sess_out Ar file | ||
4427 | Output TLS session to file. | ||
4428 | .It Fl starttls Ar protocol | ||
4429 | Send the protocol-specific messages to switch to TLS for communication. | ||
4430 | .Ar protocol | ||
4431 | is a keyword for the intended protocol. | ||
4432 | Currently, the supported keywords are | ||
4433 | .Qq ftp , | ||
4434 | .Qq imap , | ||
4435 | .Qq smtp , | ||
4436 | .Qq pop3 , | ||
4437 | and | ||
4438 | .Qq xmpp . | ||
4439 | .It Fl state | ||
4440 | Print the SSL session states. | ||
4441 | .It Fl status | ||
4442 | Send a certificate status request to the server (OCSP stapling). | ||
4443 | The server response (if any) is printed out. | ||
4444 | .It Fl timeout | ||
4445 | Enable send/receive timeout on DTLS connections. | ||
4446 | .It Fl tls1_2 | tls1_3 | ||
4447 | Permit only TLS1.2 or 1.3 respectively. | ||
4448 | .It Fl tlsextdebug | ||
4449 | Print a hex dump of any TLS extensions received from the server. | ||
4450 | .It Fl use_srtp Ar profiles | ||
4451 | Offer SRTP key management with a colon-separated profile list. | ||
4452 | .It Fl verify Ar depth | ||
4453 | Turn on server certificate verification, | ||
4454 | with a maximum length of | ||
4455 | .Ar depth . | ||
4456 | Currently the verify operation continues after errors so all the problems | ||
4457 | with a certificate chain can be seen. | ||
4458 | As a side effect the connection will never fail due to a server | ||
4459 | certificate verify failure. | ||
4460 | .It Fl verify_return_error | ||
4461 | Return verification error. | ||
4462 | .It Fl xmpphost Ar hostname | ||
4463 | When used with | ||
4464 | .Fl starttls Ar xmpp , | ||
4465 | specify the host for the "to" attribute of the stream element. | ||
4466 | If this option is not specified then the host specified with | ||
4467 | .Fl connect | ||
4468 | will be used. | ||
4469 | .El | ||
4470 | .Tg s_server | ||
4471 | .Sh S_SERVER | ||
4472 | .Bl -hang -width "openssl s_server" | ||
4473 | .It Nm openssl s_server | ||
4474 | .Bk -words | ||
4475 | .Op Fl accept Ar port | ||
4476 | .Op Fl alpn Ar protocols | ||
4477 | .Op Fl bugs | ||
4478 | .Op Fl CAfile Ar file | ||
4479 | .Op Fl CApath Ar directory | ||
4480 | .Op Fl cert Ar file | ||
4481 | .Op Fl cert2 Ar file | ||
4482 | .Op Fl certform Cm der | pem | ||
4483 | .Op Fl cipher Ar cipherlist | ||
4484 | .Op Fl context Ar id | ||
4485 | .Op Fl crl_check | ||
4486 | .Op Fl crl_check_all | ||
4487 | .Op Fl crlf | ||
4488 | .Op Fl dcert Ar file | ||
4489 | .Op Fl dcertform Cm der | pem | ||
4490 | .Op Fl debug | ||
4491 | .Op Fl dhparam Ar file | ||
4492 | .Op Fl dkey Ar file | ||
4493 | .Op Fl dkeyform Cm der | pem | ||
4494 | .Op Fl dpass Ar arg | ||
4495 | .Op Fl dtls | ||
4496 | .Op Fl dtls1 | ||
4497 | .Op Fl dtls1_2 | ||
4498 | .Op Fl groups Ar list | ||
4499 | .Op Fl HTTP | ||
4500 | .Op Fl id_prefix Ar arg | ||
4501 | .Op Fl key Ar keyfile | ||
4502 | .Op Fl key2 Ar keyfile | ||
4503 | .Op Fl keyform Cm der | pem | ||
4504 | .Op Fl keymatexport Ar label | ||
4505 | .Op Fl keymatexportlen Ar len | ||
4506 | .Op Fl msg | ||
4507 | .Op Fl mtu Ar mtu | ||
4508 | .Op Fl naccept Ar num | ||
4509 | .Op Fl named_curve Ar arg | ||
4510 | .Op Fl nbio | ||
4511 | .Op Fl nbio_test | ||
4512 | .Op Fl no_cache | ||
4513 | .Op Fl no_dhe | ||
4514 | .Op Fl no_ecdhe | ||
4515 | .Op Fl no_ticket | ||
4516 | .Op Fl no_tls1_2 | ||
4517 | .Op Fl no_tls1_3 | ||
4518 | .Op Fl no_tmp_rsa | ||
4519 | .Op Fl nocert | ||
4520 | .Op Fl pass Ar arg | ||
4521 | .Op Fl quiet | ||
4522 | .Op Fl servername Ar name | ||
4523 | .Op Fl servername_fatal | ||
4524 | .Op Fl serverpref | ||
4525 | .Op Fl state | ||
4526 | .Op Fl status | ||
4527 | .Op Fl status_timeout Ar nsec | ||
4528 | .Op Fl status_url Ar url | ||
4529 | .Op Fl status_verbose | ||
4530 | .Op Fl timeout | ||
4531 | .Op Fl tls1_2 | ||
4532 | .Op Fl tls1_3 | ||
4533 | .Op Fl tlsextdebug | ||
4534 | .Op Fl use_srtp Ar profiles | ||
4535 | .Op Fl Verify Ar depth | ||
4536 | .Op Fl verify Ar depth | ||
4537 | .Op Fl verify_return_error | ||
4538 | .Op Fl WWW | ||
4539 | .Op Fl www | ||
4540 | .Ek | ||
4541 | .El | ||
4542 | .Pp | ||
4543 | The | ||
4544 | .Nm s_server | ||
4545 | command implements a generic SSL/TLS server which listens | ||
4546 | for connections on a given port using SSL/TLS. | ||
4547 | .Pp | ||
4548 | If a connection request is established with a client and neither the | ||
4549 | .Fl www | ||
4550 | nor the | ||
4551 | .Fl WWW | ||
4552 | option has been used, then any data received | ||
4553 | from the client is displayed and any key presses are sent to the client. | ||
4554 | Certain single letter commands perform special operations: | ||
4555 | .Pp | ||
4556 | .Bl -tag -width "XXXX" -compact | ||
4557 | .It Ic P | ||
4558 | Send plain text, which should cause the client to disconnect. | ||
4559 | .It Ic Q | ||
4560 | End the current SSL connection and exit. | ||
4561 | .It Ic q | ||
4562 | End the current SSL connection, but still accept new connections. | ||
4563 | .It Ic R | ||
4564 | Renegotiate the SSL session and request a client certificate. | ||
4565 | .It Ic r | ||
4566 | Renegotiate the SSL session. | ||
4567 | .It Ic S | ||
4568 | Print out some session cache status information. | ||
4569 | .El | ||
4570 | .Pp | ||
4571 | The options are as follows: | ||
4572 | .Bl -tag -width Ds | ||
4573 | .It Fl accept Ar port | ||
4574 | Listen on TCP | ||
4575 | .Ar port | ||
4576 | for connections. | ||
4577 | The default is port 4433. | ||
4578 | .It Fl alpn Ar protocols | ||
4579 | Enable the Application-Layer Protocol Negotiation. | ||
4580 | .Ar protocols | ||
4581 | is a comma-separated list of supported protocol names. | ||
4582 | .It Fl bugs | ||
4583 | Enable various workarounds for buggy implementations. | ||
4584 | .It Fl CAfile Ar file | ||
4585 | A | ||
4586 | .Ar file | ||
4587 | containing trusted certificates to use during client authentication | ||
4588 | and to use when attempting to build the server certificate chain. | ||
4589 | The list is also used in the list of acceptable client CAs passed to the | ||
4590 | client when a certificate is requested. | ||
4591 | .It Fl CApath Ar directory | ||
4592 | The | ||
4593 | .Ar directory | ||
4594 | to use for client certificate verification. | ||
4595 | This directory must be in | ||
4596 | .Qq hash format ; | ||
4597 | see | ||
4598 | .Fl verify | ||
4599 | for more information. | ||
4600 | These are also used when building the server certificate chain. | ||
4601 | .It Fl cert Ar file | ||
4602 | The certificate to use: most server's cipher suites require the use of a | ||
4603 | certificate and some require a certificate with a certain public key type. | ||
4604 | For example, the DSS cipher suites require a certificate containing a DSS | ||
4605 | (DSA) key. | ||
4606 | If not specified, the file | ||
4607 | .Pa server.pem | ||
4608 | will be used. | ||
4609 | .It Fl cert2 Ar file | ||
4610 | The certificate to use for servername. | ||
4611 | .It Fl certform Cm der | pem | ||
4612 | The certificate format. | ||
4613 | The default is | ||
4614 | .Cm pem . | ||
4615 | .It Fl cipher Ar cipherlist | ||
4616 | Modify the cipher list used by the server. | ||
4617 | This allows the cipher list used by the server to be modified. | ||
4618 | When the client sends a list of supported ciphers, the first client cipher | ||
4619 | also included in the server list is used. | ||
4620 | Because the client specifies the preference order, the order of the server | ||
4621 | cipherlist is irrelevant. | ||
4622 | See the | ||
4623 | .Nm ciphers | ||
4624 | command for more information. | ||
4625 | .It Fl context Ar id | ||
4626 | Set the SSL context ID. | ||
4627 | It can be given any string value. | ||
4628 | .It Fl crl_check , crl_check_all | ||
4629 | Check the peer certificate has not been revoked by its CA. | ||
4630 | The CRLs are appended to the certificate file. | ||
4631 | .Fl crl_check_all | ||
4632 | checks all CRLs of all CAs in the chain. | ||
4633 | .It Fl crlf | ||
4634 | Translate a line feed from the terminal into CR+LF. | ||
4635 | .It Fl dcert Ar file , Fl dkey Ar file | ||
4636 | Specify an additional certificate and private key; these behave in the | ||
4637 | same manner as the | ||
4638 | .Fl cert | ||
4639 | and | ||
4640 | .Fl key | ||
4641 | options except there is no default if they are not specified | ||
4642 | (no additional certificate or key is used). | ||
4643 | By using RSA and DSS certificates and keys, | ||
4644 | a server can support clients which only support RSA or DSS cipher suites | ||
4645 | by using an appropriate certificate. | ||
4646 | .It Fl dcertform Cm der | pem , Fl dkeyform Cm der | pem , Fl dpass Ar arg | ||
4647 | Additional certificate and private key format, and private key password source, | ||
4648 | respectively. | ||
4649 | .It Fl debug | ||
4650 | Print extensive debugging information, including a hex dump of all traffic. | ||
4651 | .It Fl dhparam Ar file | ||
4652 | The DH parameter file to use. | ||
4653 | The ephemeral DH cipher suites generate keys | ||
4654 | using a set of DH parameters. | ||
4655 | If not specified, an attempt is made to | ||
4656 | load the parameters from the server certificate file. | ||
4657 | If this fails, a static set of parameters hard coded into the | ||
4658 | .Nm s_server | ||
4659 | program will be used. | ||
4660 | .It Fl dtls | ||
4661 | Permit any version of DTLS. | ||
4662 | .It Fl dtls1_2 | ||
4663 | Permit only DTLS1.2. | ||
4664 | .It Fl groups Ar list | ||
4665 | Set the supported elliptic curve groups to the colon separated | ||
4666 | .Ar list | ||
4667 | of group NIDs or names as documented in | ||
4668 | .Xr SSL_CTX_set1_groups_list 3 . | ||
4669 | .It Fl HTTP | ||
4670 | Emulate a simple web server. | ||
4671 | Pages are resolved relative to the current directory. | ||
4672 | For example if the URL | ||
4673 | .Pa https://myhost/page.html | ||
4674 | is requested, the file | ||
4675 | .Pa ./page.html | ||
4676 | will be loaded. | ||
4677 | The files loaded are assumed to contain a complete and correct HTTP | ||
4678 | response (lines that are part of the HTTP response line and headers | ||
4679 | must end with CRLF). | ||
4680 | .It Fl id_prefix Ar arg | ||
4681 | Generate SSL/TLS session IDs prefixed by | ||
4682 | .Ar arg . | ||
4683 | This is mostly useful for testing any SSL/TLS code | ||
4684 | that wish to deal with multiple servers, | ||
4685 | when each of which might be generating a unique range of session IDs. | ||
4686 | .It Fl key Ar keyfile | ||
4687 | The private key to use. | ||
4688 | If not specified, the certificate file will be used. | ||
4689 | .It Fl key2 Ar keyfile | ||
4690 | The private key to use for servername. | ||
4691 | .It Fl keyform Cm der | pem | ||
4692 | The private key format. | ||
4693 | The default is | ||
4694 | .Cm pem . | ||
4695 | .It Fl keymatexport Ar label | ||
4696 | Export keying material using label. | ||
4697 | .It Fl keymatexportlen Ar len | ||
4698 | Export len bytes of keying material (default 20). | ||
4699 | .It Fl msg | ||
4700 | Show all protocol messages with hex dump. | ||
4701 | .It Fl mtu Ar mtu | ||
4702 | Set the link layer MTU. | ||
4703 | .It Fl naccept Ar num | ||
4704 | Terminate server after | ||
4705 | .Ar num | ||
4706 | connections. | ||
4707 | .It Fl named_curve Ar arg | ||
4708 | Specify the elliptic curve name to use for ephemeral ECDH keys. | ||
4709 | This option is deprecated; use | ||
4710 | .Fl groups | ||
4711 | instead. | ||
4712 | .It Fl nbio | ||
4713 | Turn on non-blocking I/O. | ||
4714 | .It Fl nbio_test | ||
4715 | Test non-blocking I/O. | ||
4716 | .It Fl no_cache | ||
4717 | Disable session caching. | ||
4718 | .It Fl no_dhe | ||
4719 | Disable ephemeral DH cipher suites. | ||
4720 | .It Fl no_ecdhe | ||
4721 | Disable ephemeral ECDH cipher suites. | ||
4722 | .It Fl no_ticket | ||
4723 | Disable RFC 4507 session ticket support. | ||
4724 | .It Fl no_tls1_2 | no_tls1_3 | ||
4725 | Disable the use of TLS1.2 and 1.3, respectively. | ||
4726 | .It Fl no_tmp_rsa | ||
4727 | Disable temporary RSA key generation. | ||
4728 | .It Fl nocert | ||
4729 | Do not use a certificate. | ||
4730 | This restricts the cipher suites available to the anonymous ones | ||
4731 | (currently just anonymous DH). | ||
4732 | .It Fl pass Ar arg | ||
4733 | The private key password source. | ||
4734 | .It Fl quiet | ||
4735 | Inhibit printing of session and certificate information. | ||
4736 | .It Fl servername Ar name | ||
4737 | Set the TLS Server Name Indication (SNI) extension with | ||
4738 | .Ar name . | ||
4739 | .It Fl servername_fatal | ||
4740 | Send fatal alert if servername does not match. | ||
4741 | The default is warning alert. | ||
4742 | .It Fl serverpref | ||
4743 | Use server's cipher preferences. | ||
4744 | .It Fl state | ||
4745 | Print the SSL session states. | ||
4746 | .It Fl status | ||
4747 | Enables certificate status request support (OCSP stapling). | ||
4748 | .It Fl status_timeout Ar nsec | ||
4749 | Sets the timeout for OCSP response in seconds. | ||
4750 | .It Fl status_url Ar url | ||
4751 | Sets a fallback responder URL to use if no responder URL is present in the | ||
4752 | server certificate. | ||
4753 | Without this option, an error is returned if the server certificate does not | ||
4754 | contain a responder address. | ||
4755 | .It Fl status_verbose | ||
4756 | Enables certificate status request support (OCSP stapling) and gives a verbose | ||
4757 | printout of the OCSP response. | ||
4758 | .It Fl timeout | ||
4759 | Enable send/receive timeout on DTLS connections. | ||
4760 | .It Fl tls1_2 | tls1_3 | ||
4761 | Permit only TLS1.2, or 1.3, respectively. | ||
4762 | .It Fl tlsextdebug | ||
4763 | Print a hex dump of any TLS extensions received from the server. | ||
4764 | .It Fl use_srtp Ar profiles | ||
4765 | Offer SRTP key management with a colon-separated profile list. | ||
4766 | .It Fl verify_return_error | ||
4767 | Return verification error. | ||
4768 | .It Fl WWW | ||
4769 | Emulate a simple web server. | ||
4770 | Pages are resolved relative to the current directory. | ||
4771 | For example if the URL | ||
4772 | .Pa https://myhost/page.html | ||
4773 | is requested, the file | ||
4774 | .Pa ./page.html | ||
4775 | will be loaded. | ||
4776 | .It Fl www | ||
4777 | Send a status message to the client when it connects, | ||
4778 | including information about the ciphers used and various session parameters. | ||
4779 | The output is in HTML format so this option will normally be used with a | ||
4780 | web browser. | ||
4781 | .It Fl Verify Ar depth , Fl verify Ar depth | ||
4782 | Request a certificate chain from the client, | ||
4783 | with a maximum length of | ||
4784 | .Ar depth . | ||
4785 | With | ||
4786 | .Fl Verify , | ||
4787 | the client must supply a certificate or an error occurs; | ||
4788 | with | ||
4789 | .Fl verify , | ||
4790 | a certificate is requested but the client does not have to send one. | ||
4791 | .El | ||
4792 | .Tg s_time | ||
4793 | .Sh S_TIME | ||
4794 | .Bl -hang -width "openssl s_time" | ||
4795 | .It Nm openssl s_time | ||
4796 | .Bk -words | ||
4797 | .Op Fl bugs | ||
4798 | .Op Fl CAfile Ar file | ||
4799 | .Op Fl CApath Ar directory | ||
4800 | .Op Fl cert Ar file | ||
4801 | .Op Fl cipher Ar cipherlist | ||
4802 | .Op Fl connect Ar host Ns Op : Ns Ar port | ||
4803 | .Op Fl key Ar keyfile | ||
4804 | .Op Fl nbio | ||
4805 | .Op Fl new | ||
4806 | .Op Fl no_shutdown | ||
4807 | .Op Fl reuse | ||
4808 | .Op Fl time Ar seconds | ||
4809 | .Op Fl verify Ar depth | ||
4810 | .Op Fl www Ar page | ||
4811 | .Ek | ||
4812 | .El | ||
4813 | .Pp | ||
4814 | The | ||
4815 | .Nm s_time | ||
4816 | command implements a generic SSL/TLS client which connects to a | ||
4817 | remote host using SSL/TLS. | ||
4818 | It can request a page from the server and includes | ||
4819 | the time to transfer the payload data in its timing measurements. | ||
4820 | It measures the number of connections within a given timeframe, | ||
4821 | the amount of data transferred | ||
4822 | .Pq if any , | ||
4823 | and calculates the average time spent for one connection. | ||
4824 | .Pp | ||
4825 | The options are as follows: | ||
4826 | .Bl -tag -width Ds | ||
4827 | .It Fl bugs | ||
4828 | Enable various workarounds for buggy implementations. | ||
4829 | .It Fl CAfile Ar file | ||
4830 | A | ||
4831 | .Ar file | ||
4832 | containing trusted certificates to use during server authentication | ||
4833 | and to use when attempting to build the client certificate chain. | ||
4834 | .It Fl CApath Ar directory | ||
4835 | The directory to use for server certificate verification. | ||
4836 | This directory must be in | ||
4837 | .Qq hash format ; | ||
4838 | see | ||
4839 | .Nm verify | ||
4840 | for more information. | ||
4841 | These are also used when building the client certificate chain. | ||
4842 | .It Fl cert Ar file | ||
4843 | The certificate to use, if one is requested by the server. | ||
4844 | The default is not to use a certificate. | ||
4845 | .It Fl cipher Ar cipherlist | ||
4846 | Modify the cipher list sent by the client. | ||
4847 | Although the server determines which cipher suite is used, | ||
4848 | it should take the first supported cipher in the list sent by the client. | ||
4849 | See the | ||
4850 | .Nm ciphers | ||
4851 | command for more information. | ||
4852 | .It Fl connect Ar host Ns Op : Ns Ar port | ||
4853 | The host and port to connect to. | ||
4854 | .It Fl key Ar keyfile | ||
4855 | The private key to use. | ||
4856 | If not specified, the certificate file will be used. | ||
4857 | .It Fl nbio | ||
4858 | Turn on non-blocking I/O. | ||
4859 | .It Fl new | ||
4860 | Perform the timing test using a new session ID for each connection. | ||
4861 | If neither | ||
4862 | .Fl new | ||
4863 | nor | ||
4864 | .Fl reuse | ||
4865 | are specified, | ||
4866 | they are both on by default and executed in sequence. | ||
4867 | .It Fl no_shutdown | ||
4868 | Shut down the connection without sending a | ||
4869 | .Qq close notify | ||
4870 | shutdown alert to the server. | ||
4871 | .It Fl reuse | ||
4872 | Perform the timing test using the same session ID for each connection. | ||
4873 | If neither | ||
4874 | .Fl new | ||
4875 | nor | ||
4876 | .Fl reuse | ||
4877 | are specified, | ||
4878 | they are both on by default and executed in sequence. | ||
4879 | .It Fl time Ar seconds | ||
4880 | Limit | ||
4881 | .Nm s_time | ||
4882 | benchmarks to the number of | ||
4883 | .Ar seconds . | ||
4884 | The default is 30 seconds. | ||
4885 | .It Fl verify Ar depth | ||
4886 | Turn on server certificate verification, | ||
4887 | with a maximum length of | ||
4888 | .Ar depth . | ||
4889 | Currently the verify operation continues after errors, so all the problems | ||
4890 | with a certificate chain can be seen. | ||
4891 | As a side effect, | ||
4892 | the connection will never fail due to a server certificate verify failure. | ||
4893 | .It Fl www Ar page | ||
4894 | The page to GET from the server. | ||
4895 | A value of | ||
4896 | .Sq / | ||
4897 | gets the index.htm[l] page. | ||
4898 | If this parameter is not specified, | ||
4899 | .Nm s_time | ||
4900 | will only perform the handshake to establish SSL connections | ||
4901 | but not transfer any payload data. | ||
4902 | .El | ||
4903 | .Tg sess_id | ||
4904 | .Sh SESS_ID | ||
4905 | .Bl -hang -width "openssl sess_id" | ||
4906 | .It Nm openssl sess_id | ||
4907 | .Bk -words | ||
4908 | .Op Fl cert | ||
4909 | .Op Fl context Ar ID | ||
4910 | .Op Fl in Ar file | ||
4911 | .Op Fl inform Cm der | pem | ||
4912 | .Op Fl noout | ||
4913 | .Op Fl out Ar file | ||
4914 | .Op Fl outform Cm der | pem | ||
4915 | .Op Fl text | ||
4916 | .Ek | ||
4917 | .El | ||
4918 | .Pp | ||
4919 | The | ||
4920 | .Nm sess_id | ||
4921 | program processes the encoded version of the SSL session structure and | ||
4922 | optionally prints out SSL session details | ||
4923 | (for example the SSL session master key) | ||
4924 | in human-readable format. | ||
4925 | .Pp | ||
4926 | The options are as follows: | ||
4927 | .Bl -tag -width Ds | ||
4928 | .It Fl cert | ||
4929 | If a certificate is present in the session, | ||
4930 | it will be output using this option; | ||
4931 | if the | ||
4932 | .Fl text | ||
4933 | option is also present, then it will be printed out in text form. | ||
4934 | .It Fl context Ar ID | ||
4935 | Set the session | ||
4936 | .Ar ID . | ||
4937 | The ID can be any string of characters. | ||
4938 | .It Fl in Ar file | ||
4939 | The input file to read from, | ||
4940 | or standard input if not specified. | ||
4941 | .It Fl inform Cm der | pem | ||
4942 | The input format. | ||
4943 | .Cm der | ||
4944 | uses an ASN.1 DER-encoded format containing session details. | ||
4945 | The precise format can vary from one version to the next. | ||
4946 | .Cm pem | ||
4947 | is the default format: it consists of the DER | ||
4948 | format base64-encoded with additional header and footer lines. | ||
4949 | .It Fl noout | ||
4950 | Do not output the encoded version of the session. | ||
4951 | .It Fl out Ar file | ||
4952 | The output file to write to, | ||
4953 | or standard output if not specified. | ||
4954 | .It Fl outform Cm der | pem | ||
4955 | The output format. | ||
4956 | .It Fl text | ||
4957 | Print the various public or private key components in plain text, | ||
4958 | in addition to the encoded version. | ||
4959 | .El | ||
4960 | .Pp | ||
4961 | The output of | ||
4962 | .Nm sess_id | ||
4963 | is composed as follows: | ||
4964 | .Pp | ||
4965 | .Bl -tag -width "Verify return code " -offset 3n -compact | ||
4966 | .It Protocol | ||
4967 | The protocol in use. | ||
4968 | .It Cipher | ||
4969 | The actual raw SSL or TLS cipher code. | ||
4970 | .It Session-ID | ||
4971 | The SSL session ID, in hex format. | ||
4972 | .It Session-ID-ctx | ||
4973 | The session ID context, in hex format. | ||
4974 | .It Master-Key | ||
4975 | The SSL session master key. | ||
4976 | .It Key-Arg | ||
4977 | The key argument; this is only used in SSL v2. | ||
4978 | .It Start Time | ||
4979 | The session start time. | ||
4980 | .Ux | ||
4981 | format. | ||
4982 | .It Timeout | ||
4983 | The timeout, in seconds. | ||
4984 | .It Verify return code | ||
4985 | The return code when a certificate is verified. | ||
4986 | .El | ||
4987 | .Pp | ||
4988 | Since the SSL session output contains the master key, it is possible to read | ||
4989 | the contents of an encrypted session using this information. | ||
4990 | Therefore appropriate security precautions | ||
4991 | should be taken if the information is being output by a | ||
4992 | .Qq real | ||
4993 | application. | ||
4994 | This is, however, strongly discouraged and should only be used for | ||
4995 | debugging purposes. | ||
4996 | .Tg smime | ||
4997 | .Sh SMIME | ||
4998 | .Bl -hang -width "openssl smime" | ||
4999 | .It Nm openssl smime | ||
5000 | .Bk -words | ||
5001 | .Oo | ||
5002 | .Fl aes128 | aes192 | aes256 | des | | ||
5003 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 | ||
5004 | .Oc | ||
5005 | .Op Fl binary | ||
5006 | .Op Fl CAfile Ar file | ||
5007 | .Op Fl CApath Ar directory | ||
5008 | .Op Fl certfile Ar file | ||
5009 | .Op Fl check_ss_sig | ||
5010 | .Op Fl content Ar file | ||
5011 | .Op Fl crl_check | ||
5012 | .Op Fl crl_check_all | ||
5013 | .Op Fl decrypt | ||
5014 | .Op Fl encrypt | ||
5015 | .Op Fl extended_crl | ||
5016 | .Op Fl from Ar addr | ||
5017 | .Op Fl ignore_critical | ||
5018 | .Op Fl in Ar file | ||
5019 | .Op Fl indef | ||
5020 | .Op Fl inform Cm der | pem | smime | ||
5021 | .Op Fl inkey Ar file | ||
5022 | .Op Fl issuer_checks | ||
5023 | .Op Fl keyform Cm der | pem | ||
5024 | .Op Fl md Ar digest | ||
5025 | .Op Fl noattr | ||
5026 | .Op Fl nocerts | ||
5027 | .Op Fl nochain | ||
5028 | .Op Fl nodetach | ||
5029 | .Op Fl noindef | ||
5030 | .Op Fl nointern | ||
5031 | .Op Fl nosigs | ||
5032 | .Op Fl nosmimecap | ||
5033 | .Op Fl noverify | ||
5034 | .Op Fl out Ar file | ||
5035 | .Op Fl outform Cm der | pem | smime | ||
5036 | .Op Fl passin Ar arg | ||
5037 | .Op Fl pk7out | ||
5038 | .Op Fl policy_check | ||
5039 | .Op Fl recip Ar file | ||
5040 | .Op Fl resign | ||
5041 | .Op Fl sign | ||
5042 | .Op Fl signer Ar file | ||
5043 | .Op Fl stream | ||
5044 | .Op Fl subject Ar s | ||
5045 | .Op Fl text | ||
5046 | .Op Fl to Ar addr | ||
5047 | .Op Fl verify | ||
5048 | .Op Fl x509_strict | ||
5049 | .Op Ar cert.pem ... | ||
5050 | .Ek | ||
5051 | .El | ||
5052 | .Pp | ||
5053 | The | ||
5054 | .Nm smime | ||
5055 | command handles S/MIME mail. | ||
5056 | It can encrypt, decrypt, sign, and verify S/MIME messages. | ||
5057 | .Pp | ||
5058 | The MIME message must be sent without any blank lines between the | ||
5059 | headers and the output. | ||
5060 | Some mail programs will automatically add a blank line. | ||
5061 | Piping the mail directly to an MTA is one way to | ||
5062 | achieve the correct format. | ||
5063 | .Pp | ||
5064 | The supplied message to be signed or encrypted must include the necessary | ||
5065 | MIME headers or many S/MIME clients won't display it properly (if at all). | ||
5066 | Use the | ||
5067 | .Fl text | ||
5068 | option to automatically add plain text headers. | ||
5069 | .Pp | ||
5070 | A | ||
5071 | .Qq signed and encrypted | ||
5072 | message is one where a signed message is then encrypted. | ||
5073 | This can be produced by encrypting an already signed message. | ||
5074 | .Pp | ||
5075 | There are a number of operations that can be performed, as follows: | ||
5076 | .Bl -tag -width "XXXX" | ||
5077 | .It Fl decrypt | ||
5078 | Decrypt mail using the supplied certificate and private key. | ||
5079 | The input file is an encrypted mail message in MIME format. | ||
5080 | The decrypted mail is written to the output file. | ||
5081 | .It Fl encrypt | ||
5082 | Encrypt mail for the given recipient certificates. | ||
5083 | The input is the message to be encrypted. | ||
5084 | The output file is the encrypted mail, in MIME format. | ||
5085 | .It Fl pk7out | ||
5086 | Take an input message and write out a PEM-encoded PKCS#7 structure. | ||
5087 | .It Fl resign | ||
5088 | Resign a message: take an existing message and one or more new signers. | ||
5089 | .It Fl sign | ||
5090 | Sign mail using the supplied certificate and private key. | ||
5091 | The input file is the message to be signed. | ||
5092 | The signed message, in MIME format, is written to the output file. | ||
5093 | .It Fl verify | ||
5094 | Verify signed mail. | ||
5095 | The input is a signed mail message and the output is the signed data. | ||
5096 | Both clear text and opaque signing is supported. | ||
5097 | .El | ||
5098 | .Pp | ||
5099 | The remaining options are as follows: | ||
5100 | .Bl -tag -width "XXXX" | ||
5101 | .It Xo | ||
5102 | .Fl aes128 | aes192 | aes256 | des | | ||
5103 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 | ||
5104 | .Xc | ||
5105 | The encryption algorithm to use. | ||
5106 | 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits), | ||
5107 | or 40-, 64-, or 128-bit RC2, respectively; | ||
5108 | if not specified, 40-bit RC2 is | ||
5109 | used. | ||
5110 | Only used with | ||
5111 | .Fl encrypt . | ||
5112 | .It Fl binary | ||
5113 | Normally, the input message is converted to | ||
5114 | .Qq canonical | ||
5115 | format which uses CR/LF as end of line, | ||
5116 | as required by the S/MIME specification. | ||
5117 | When this option is present, no translation occurs. | ||
5118 | This is useful when handling binary data which may not be in MIME format. | ||
5119 | .It Fl CAfile Ar file | ||
5120 | A | ||
5121 | .Ar file | ||
5122 | containing trusted CA certificates; only used with | ||
5123 | .Fl verify . | ||
5124 | .It Fl CApath Ar directory | ||
5125 | A | ||
5126 | .Ar directory | ||
5127 | containing trusted CA certificates; only used with | ||
5128 | .Fl verify . | ||
5129 | This directory must be a standard certificate directory: | ||
5130 | that is, a hash of each subject name (using | ||
5131 | .Nm x509 -hash ) | ||
5132 | should be linked to each certificate. | ||
5133 | .It Ar cert.pem ... | ||
5134 | One or more certificates of message recipients: used when encrypting | ||
5135 | a message. | ||
5136 | .It Fl certfile Ar file | ||
5137 | Allows additional certificates to be specified. | ||
5138 | When signing, these will be included with the message. | ||
5139 | When verifying, these will be searched for the signers' certificates. | ||
5140 | The certificates should be in PEM format. | ||
5141 | .It Xo | ||
5142 | .Fl check_ss_sig , | ||
5143 | .Fl crl_check , | ||
5144 | .Fl crl_check_all , | ||
5145 | .Fl extended_crl , | ||
5146 | .Fl ignore_critical , | ||
5147 | .Fl issuer_checks , | ||
5148 | .Fl policy_check , | ||
5149 | .Fl x509_strict | ||
5150 | .Xc | ||
5151 | Set various certificate chain validation options. | ||
5152 | See the | ||
5153 | .Nm verify | ||
5154 | command for details. | ||
5155 | .It Fl content Ar file | ||
5156 | A file containing the detached content. | ||
5157 | This is only useful with the | ||
5158 | .Fl verify | ||
5159 | option, | ||
5160 | and only usable if the PKCS#7 structure is using the detached | ||
5161 | signature form where the content is not included. | ||
5162 | This option will override any content if the input format is S/MIME | ||
5163 | and it uses the multipart/signed MIME content type. | ||
5164 | .It Xo | ||
5165 | .Fl from Ar addr , | ||
5166 | .Fl subject Ar s , | ||
5167 | .Fl to Ar addr | ||
5168 | .Xc | ||
5169 | The relevant mail headers. | ||
5170 | These are included outside the signed | ||
5171 | portion of a message so they may be included manually. | ||
5172 | When signing, many S/MIME | ||
5173 | mail clients check that the signer's certificate email | ||
5174 | address matches the From: address. | ||
5175 | .It Fl in Ar file | ||
5176 | The input file to read from. | ||
5177 | .It Fl indef | ||
5178 | Enable streaming I/O for encoding operations. | ||
5179 | This permits single pass processing of data without | ||
5180 | the need to hold the entire contents in memory, | ||
5181 | potentially supporting very large files. | ||
5182 | Streaming is automatically set for S/MIME signing with detached | ||
5183 | data if the output format is SMIME; | ||
5184 | it is currently off by default for all other operations. | ||
5185 | .It Fl inform Cm der | pem | smime | ||
5186 | The input format. | ||
5187 | .It Fl inkey Ar file | ||
5188 | The private key to use when signing or decrypting, | ||
5189 | which must match the corresponding certificate. | ||
5190 | If this option is not specified, the private key must be included | ||
5191 | in the certificate file specified with | ||
5192 | the | ||
5193 | .Fl recip | ||
5194 | or | ||
5195 | .Fl signer | ||
5196 | file. | ||
5197 | When signing, | ||
5198 | this option can be used multiple times to specify successive keys. | ||
5199 | .It Fl keyform Cm der | pem | ||
5200 | Input private key format. | ||
5201 | The default is | ||
5202 | .Cm pem . | ||
5203 | .It Fl md Ar digest | ||
5204 | The digest algorithm to use when signing or resigning. | ||
5205 | If not present then the default digest algorithm for the signing key is used | ||
5206 | (usually SHA1). | ||
5207 | .It Fl noattr | ||
5208 | Do not include attributes. | ||
5209 | .It Fl nocerts | ||
5210 | Do not include the signer's certificate. | ||
5211 | This will reduce the size of the signed message but the verifier must | ||
5212 | have a copy of the signer's certificate available locally (passed using the | ||
5213 | .Fl certfile | ||
5214 | option, for example). | ||
5215 | .It Fl nochain | ||
5216 | Do not do chain verification of signers' certificates: that is, | ||
5217 | don't use the certificates in the signed message as untrusted CAs. | ||
5218 | .It Fl nodetach | ||
5219 | When signing a message, use opaque signing: this form is more resistant | ||
5220 | to translation by mail relays but it cannot be read by mail agents that | ||
5221 | do not support S/MIME. | ||
5222 | Without this option cleartext signing with the MIME type | ||
5223 | multipart/signed is used. | ||
5224 | .It Fl noindef | ||
5225 | Disable streaming I/O where it would produce an encoding of indefinite length | ||
5226 | (currently has no effect). | ||
5227 | .It Fl nointern | ||
5228 | Only use certificates specified in the | ||
5229 | .Fl certfile . | ||
5230 | The supplied certificates can still be used as untrusted CAs. | ||
5231 | .It Fl nosigs | ||
5232 | Do not try to verify the signatures on the message. | ||
5233 | .It Fl nosmimecap | ||
5234 | Exclude the list of supported algorithms from signed attributes, | ||
5235 | other options such as signing time and content type are still included. | ||
5236 | .It Fl noverify | ||
5237 | Do not verify the signer's certificate of a signed message. | ||
5238 | .It Fl out Ar file | ||
5239 | The output file to write to. | ||
5240 | .It Fl outform Cm der | pem | smime | ||
5241 | The output format. | ||
5242 | The default is smime, which writes an S/MIME format message. | ||
5243 | .Cm pem | ||
5244 | and | ||
5245 | .Cm der | ||
5246 | change this to write PEM and DER format PKCS#7 structures instead. | ||
5247 | This currently only affects the output format of the PKCS#7 | ||
5248 | structure; if no PKCS#7 structure is being output (for example with | ||
5249 | .Fl verify | ||
5250 | or | ||
5251 | .Fl decrypt ) | ||
5252 | this option has no effect. | ||
5253 | .It Fl passin Ar arg | ||
5254 | The key password source. | ||
5255 | .It Fl recip Ar file | ||
5256 | The recipients certificate when decrypting a message. | ||
5257 | This certificate | ||
5258 | must match one of the recipients of the message or an error occurs. | ||
5259 | .It Fl signer Ar file | ||
5260 | A signing certificate when signing or resigning a message; | ||
5261 | this option can be used multiple times if more than one signer is required. | ||
5262 | If a message is being verified, the signer's certificates will be | ||
5263 | written to this file if the verification was successful. | ||
5264 | .It Fl stream | ||
5265 | The same as | ||
5266 | .Fl indef . | ||
5267 | .It Fl text | ||
5268 | Add plain text (text/plain) MIME | ||
5269 | headers to the supplied message if encrypting or signing. | ||
5270 | If decrypting or verifying, it strips off text headers: | ||
5271 | if the decrypted or verified message is not of MIME type text/plain | ||
5272 | then an error occurs. | ||
5273 | .El | ||
5274 | .Pp | ||
5275 | The exit codes for | ||
5276 | .Nm smime | ||
5277 | are as follows: | ||
5278 | .Pp | ||
5279 | .Bl -tag -width "XXXX" -offset 3n -compact | ||
5280 | .It 0 | ||
5281 | The operation was completely successful. | ||
5282 | .It 1 | ||
5283 | An error occurred parsing the command options. | ||
5284 | .It 2 | ||
5285 | One of the input files could not be read. | ||
5286 | .It 3 | ||
5287 | An error occurred creating the file or when reading the message. | ||
5288 | .It 4 | ||
5289 | An error occurred decrypting or verifying the message. | ||
5290 | .It 5 | ||
5291 | An error occurred writing certificates. | ||
5292 | .El | ||
5293 | .Tg speed | ||
5294 | .Sh SPEED | ||
5295 | .Bl -hang -width "openssl speed" | ||
5296 | .It Nm openssl speed | ||
5297 | .Bk -words | ||
5298 | .Op Ar algorithm | ||
5299 | .Op Fl decrypt | ||
5300 | .Op Fl elapsed | ||
5301 | .Op Fl evp Ar algorithm | ||
5302 | .Op Fl mr | ||
5303 | .Op Fl multi Ar number | ||
5304 | .Op Fl unaligned Ar number | ||
5305 | .Ek | ||
5306 | .El | ||
5307 | .Pp | ||
5308 | The | ||
5309 | .Nm speed | ||
5310 | command is used to test the performance of cryptographic algorithms. | ||
5311 | .Bl -tag -width "XXXX" | ||
5312 | .It Ar algorithm | ||
5313 | Perform the test using | ||
5314 | .Ar algorithm . | ||
5315 | The default is to test all algorithms. | ||
5316 | .It Fl decrypt | ||
5317 | Time decryption instead of encryption; | ||
5318 | must be used with | ||
5319 | .Fl evp . | ||
5320 | .It Fl elapsed | ||
5321 | Measure time in real time instead of CPU user time. | ||
5322 | .It Fl evp Ar algorithm | ||
5323 | Perform the test using one of the algorithms accepted by | ||
5324 | .Xr EVP_get_cipherbyname 3 . | ||
5325 | .It Fl mr | ||
5326 | Produce machine readable output. | ||
5327 | .It Fl multi Ar number | ||
5328 | Run | ||
5329 | .Ar number | ||
5330 | benchmarks in parallel. | ||
5331 | .It Fl unaligned Ar number | ||
5332 | Use allocated buffers with an offset of | ||
5333 | .Ar number | ||
5334 | bytes from the alignment provided by | ||
5335 | .Xr malloc 3 . | ||
5336 | .Ar number | ||
5337 | should be between 0 and 16. | ||
5338 | .El | ||
5339 | .Tg ts | ||
5340 | .Sh TS | ||
5341 | .Bk -words | ||
5342 | .Bl -hang -width "openssl ts" | ||
5343 | .It Nm openssl ts | ||
5344 | .Fl query | ||
5345 | .Op Fl md4 | md5 | ripemd160 | sha1 | ||
5346 | .Op Fl cert | ||
5347 | .Op Fl config Ar configfile | ||
5348 | .Op Fl data Ar file_to_hash | ||
5349 | .Op Fl digest Ar digest_bytes | ||
5350 | .Op Fl in Ar request.tsq | ||
5351 | .Op Fl no_nonce | ||
5352 | .Op Fl out Ar request.tsq | ||
5353 | .Op Fl policy Ar object_id | ||
5354 | .Op Fl text | ||
5355 | .It Nm openssl ts | ||
5356 | .Fl reply | ||
5357 | .Op Fl chain Ar certs_file.pem | ||
5358 | .Op Fl config Ar configfile | ||
5359 | .Op Fl in Ar response.tsr | ||
5360 | .Op Fl inkey Ar private.pem | ||
5361 | .Op Fl out Ar response.tsr | ||
5362 | .Op Fl passin Ar arg | ||
5363 | .Op Fl policy Ar object_id | ||
5364 | .Op Fl queryfile Ar request.tsq | ||
5365 | .Op Fl section Ar tsa_section | ||
5366 | .Op Fl signer Ar tsa_cert.pem | ||
5367 | .Op Fl text | ||
5368 | .Op Fl token_in | ||
5369 | .Op Fl token_out | ||
5370 | .It Nm openssl ts | ||
5371 | .Fl verify | ||
5372 | .Op Fl CAfile Ar trusted_certs.pem | ||
5373 | .Op Fl CApath Ar trusted_cert_path | ||
5374 | .Op Fl data Ar file_to_hash | ||
5375 | .Op Fl digest Ar digest_bytes | ||
5376 | .Op Fl in Ar response.tsr | ||
5377 | .Op Fl queryfile Ar request.tsq | ||
5378 | .Op Fl token_in | ||
5379 | .Op Fl untrusted Ar cert_file.pem | ||
5380 | .El | ||
5381 | .Ek | ||
5382 | .Pp | ||
5383 | The | ||
5384 | .Nm ts | ||
5385 | command is a basic Time Stamping Authority (TSA) client and server | ||
5386 | application as specified in RFC 3161 (Time-Stamp Protocol, TSP). | ||
5387 | A TSA can be part of a PKI deployment and its role is to provide long | ||
5388 | term proof of the existence of specific data. | ||
5389 | Here is a brief description of the protocol: | ||
5390 | .Bl -enum | ||
5391 | .It | ||
5392 | The TSA client computes a one-way hash value for a data file and sends | ||
5393 | the hash to the TSA. | ||
5394 | .It | ||
5395 | The TSA attaches the current date and time to the received hash value, | ||
5396 | signs them and sends the time stamp token back to the client. | ||
5397 | By creating this token the TSA certifies the existence of the original | ||
5398 | data file at the time of response generation. | ||
5399 | .It | ||
5400 | The TSA client receives the time stamp token and verifies the | ||
5401 | signature on it. | ||
5402 | It also checks if the token contains the same hash | ||
5403 | value that it had sent to the TSA. | ||
5404 | .El | ||
5405 | .Pp | ||
5406 | There is one DER-encoded protocol data unit defined for transporting a time | ||
5407 | stamp request to the TSA and one for sending the time stamp response | ||
5408 | back to the client. | ||
5409 | The | ||
5410 | .Nm ts | ||
5411 | command has three main functions: | ||
5412 | creating a time stamp request based on a data file; | ||
5413 | creating a time stamp response based on a request; | ||
5414 | and verifying if a response corresponds | ||
5415 | to a particular request or a data file. | ||
5416 | .Pp | ||
5417 | There is no support for sending the requests/responses automatically | ||
5418 | over HTTP or TCP yet as suggested in RFC 3161. | ||
5419 | Users must send the requests either by FTP or email. | ||
5420 | .Pp | ||
5421 | The | ||
5422 | .Fl query | ||
5423 | switch can be used for creating and printing a time stamp | ||
5424 | request with the following options: | ||
5425 | .Bl -tag -width Ds | ||
5426 | .It Fl cert | ||
5427 | Expect the TSA to include its signing certificate in the response. | ||
5428 | .It Fl config Ar configfile | ||
5429 | Specify an alternative configuration file. | ||
5430 | Only the OID section is used. | ||
5431 | .It Fl data Ar file_to_hash | ||
5432 | The data file for which the time stamp request needs to be created. | ||
5433 | The default is standard input. | ||
5434 | .It Fl digest Ar digest_bytes | ||
5435 | Specify the message imprint explicitly without the data file. | ||
5436 | The imprint must be specified in a hexadecimal format, | ||
5437 | two characters per byte, | ||
5438 | the bytes optionally separated by colons. | ||
5439 | The number of bytes must match the message digest algorithm in use. | ||
5440 | .It Fl in Ar request.tsq | ||
5441 | A previously created time stamp request in DER | ||
5442 | format that will be printed into the output file. | ||
5443 | Useful for examining the content of a request in human-readable format. | ||
5444 | .It Fl md4 | md5 | ripemd160 | sha | sha1 | ||
5445 | The message digest to apply to the data file. | ||
5446 | It supports all the message digest algorithms that are supported by the | ||
5447 | .Nm dgst | ||
5448 | command. | ||
5449 | The default is SHA1. | ||
5450 | .It Fl no_nonce | ||
5451 | Specify no nonce in the request. | ||
5452 | The default, to include a 64-bit long pseudo-random nonce, | ||
5453 | is recommended to protect against replay attacks. | ||
5454 | .It Fl out Ar request.tsq | ||
5455 | The output file to write to, | ||
5456 | or standard output if not specified. | ||
5457 | .It Fl policy Ar object_id | ||
5458 | The policy that the client expects the TSA to use for creating the | ||
5459 | time stamp token. | ||
5460 | Either dotted OID notation or OID names defined | ||
5461 | in the config file can be used. | ||
5462 | If no policy is requested, the TSA uses its own default policy. | ||
5463 | .It Fl text | ||
5464 | Output in human-readable text format instead of DER. | ||
5465 | .El | ||
5466 | .Pp | ||
5467 | A time stamp response (TimeStampResp) consists of a response status | ||
5468 | and the time stamp token itself (ContentInfo), | ||
5469 | if the token generation was successful. | ||
5470 | The | ||
5471 | .Fl reply | ||
5472 | command is for creating a time stamp | ||
5473 | response or time stamp token based on a request and printing the | ||
5474 | response/token in human-readable format. | ||
5475 | If | ||
5476 | .Fl token_out | ||
5477 | is not specified the output is always a time stamp response (TimeStampResp), | ||
5478 | otherwise it is a time stamp token (ContentInfo). | ||
5479 | .Bl -tag -width Ds | ||
5480 | .It Fl chain Ar certs_file.pem | ||
5481 | The collection of PEM certificates | ||
5482 | that will be included in the response | ||
5483 | in addition to the signer certificate if the | ||
5484 | .Fl cert | ||
5485 | option was used for the request. | ||
5486 | This file is supposed to contain the certificate chain | ||
5487 | for the signer certificate from its issuer upwards. | ||
5488 | The | ||
5489 | .Fl reply | ||
5490 | command does not build a certificate chain automatically. | ||
5491 | .It Fl config Ar configfile | ||
5492 | Specify an alternative configuration file. | ||
5493 | .It Fl in Ar response.tsr | ||
5494 | Specify a previously created time stamp response (or time stamp token, if | ||
5495 | .Fl token_in | ||
5496 | is also specified) | ||
5497 | in DER format that will be written to the output file. | ||
5498 | This option does not require a request; | ||
5499 | it is useful, for example, | ||
5500 | to examine the content of a response or token | ||
5501 | or to extract the time stamp token from a response. | ||
5502 | If the input is a token and the output is a time stamp response, a default | ||
5503 | .Qq granted | ||
5504 | status info is added to the token. | ||
5505 | .It Fl inkey Ar private.pem | ||
5506 | The signer private key of the TSA in PEM format. | ||
5507 | Overrides the | ||
5508 | .Cm signer_key | ||
5509 | config file option. | ||
5510 | .It Fl out Ar response.tsr | ||
5511 | The response is written to this file. | ||
5512 | The format and content of the file depends on other options (see | ||
5513 | .Fl text | ||
5514 | and | ||
5515 | .Fl token_out ) . | ||
5516 | The default is stdout. | ||
5517 | .It Fl passin Ar arg | ||
5518 | The key password source. | ||
5519 | .It Fl policy Ar object_id | ||
5520 | The default policy to use for the response. | ||
5521 | Either dotted OID notation or OID names defined | ||
5522 | in the config file can be used. | ||
5523 | If no policy is requested, the TSA uses its own default policy. | ||
5524 | .It Fl queryfile Ar request.tsq | ||
5525 | The file containing a DER-encoded time stamp request. | ||
5526 | .It Fl section Ar tsa_section | ||
5527 | The config file section containing the settings for response generation. | ||
5528 | .It Fl signer Ar tsa_cert.pem | ||
5529 | The PEM signer certificate of the TSA. | ||
5530 | The TSA signing certificate must have exactly one extended key usage | ||
5531 | assigned to it: timeStamping. | ||
5532 | The extended key usage must also be critical, | ||
5533 | otherwise the certificate is going to be refused. | ||
5534 | Overrides the | ||
5535 | .Cm signer_cert | ||
5536 | variable of the config file. | ||
5537 | .It Fl text | ||
5538 | Output in human-readable text format instead of DER. | ||
5539 | .It Fl token_in | ||
5540 | The input is a DER-encoded time stamp token (ContentInfo) | ||
5541 | instead of a time stamp response (TimeStampResp). | ||
5542 | .It Fl token_out | ||
5543 | The output is a time stamp token (ContentInfo) | ||
5544 | instead of a time stamp response (TimeStampResp). | ||
5545 | .El | ||
5546 | .Pp | ||
5547 | The | ||
5548 | .Fl verify | ||
5549 | command is for verifying if a time stamp response or time stamp token | ||
5550 | is valid and matches a particular time stamp request or data file. | ||
5551 | The | ||
5552 | .Fl verify | ||
5553 | command does not use the configuration file. | ||
5554 | .Bl -tag -width Ds | ||
5555 | .It Fl CAfile Ar trusted_certs.pem | ||
5556 | The file containing a set of trusted self-signed PEM CA certificates. | ||
5557 | See | ||
5558 | .Nm verify | ||
5559 | for additional details. | ||
5560 | Either this option or | ||
5561 | .Fl CApath | ||
5562 | must be specified. | ||
5563 | .It Fl CApath Ar trusted_cert_path | ||
5564 | The directory containing the trusted CA certificates of the client. | ||
5565 | See | ||
5566 | .Nm verify | ||
5567 | for additional details. | ||
5568 | Either this option or | ||
5569 | .Fl CAfile | ||
5570 | must be specified. | ||
5571 | .It Fl data Ar file_to_hash | ||
5572 | The response or token must be verified against | ||
5573 | .Ar file_to_hash . | ||
5574 | The file is hashed with the message digest algorithm specified in the token. | ||
5575 | The | ||
5576 | .Fl digest | ||
5577 | and | ||
5578 | .Fl queryfile | ||
5579 | options must not be specified with this one. | ||
5580 | .It Fl digest Ar digest_bytes | ||
5581 | The response or token must be verified against the message digest specified | ||
5582 | with this option. | ||
5583 | The number of bytes must match the message digest algorithm | ||
5584 | specified in the token. | ||
5585 | The | ||
5586 | .Fl data | ||
5587 | and | ||
5588 | .Fl queryfile | ||
5589 | options must not be specified with this one. | ||
5590 | .It Fl in Ar response.tsr | ||
5591 | The time stamp response that needs to be verified, in DER format. | ||
5592 | This option in mandatory. | ||
5593 | .It Fl queryfile Ar request.tsq | ||
5594 | The original time stamp request, in DER format. | ||
5595 | The | ||
5596 | .Fl data | ||
5597 | and | ||
5598 | .Fl digest | ||
5599 | options must not be specified with this one. | ||
5600 | .It Fl token_in | ||
5601 | The input is a DER-encoded time stamp token (ContentInfo) | ||
5602 | instead of a time stamp response (TimeStampResp). | ||
5603 | .It Fl untrusted Ar cert_file.pem | ||
5604 | Additional untrusted PEM certificates which may be needed | ||
5605 | when building the certificate chain for the TSA's signing certificate. | ||
5606 | This file must contain the TSA signing certificate and | ||
5607 | all intermediate CA certificates unless the response includes them. | ||
5608 | .El | ||
5609 | .Pp | ||
5610 | Options specified on the command line always override | ||
5611 | the settings in the config file: | ||
5612 | .Bl -tag -width Ds | ||
5613 | .It Cm tsa Ar section , Cm default_tsa | ||
5614 | This is the main section and it specifies the name of another section | ||
5615 | that contains all the options for the | ||
5616 | .Fl reply | ||
5617 | option. | ||
5618 | This section can be overridden with the | ||
5619 | .Fl section | ||
5620 | command line switch. | ||
5621 | .It Cm oid_file | ||
5622 | See | ||
5623 | .Nm ca | ||
5624 | for a description. | ||
5625 | .It Cm oid_section | ||
5626 | See | ||
5627 | .Nm ca | ||
5628 | for a description. | ||
5629 | .It Cm serial | ||
5630 | The file containing the hexadecimal serial number of the | ||
5631 | last time stamp response created. | ||
5632 | This number is incremented by 1 for each response. | ||
5633 | If the file does not exist at the time of response generation, | ||
5634 | a new file is created with serial number 1. | ||
5635 | This parameter is mandatory. | ||
5636 | .It Cm signer_cert | ||
5637 | TSA signing certificate, in PEM format. | ||
5638 | The same as the | ||
5639 | .Fl signer | ||
5640 | command line option. | ||
5641 | .It Cm certs | ||
5642 | A set of PEM-encoded certificates that need to be | ||
5643 | included in the response. | ||
5644 | The same as the | ||
5645 | .Fl chain | ||
5646 | command line option. | ||
5647 | .It Cm signer_key | ||
5648 | The private key of the TSA, in PEM format. | ||
5649 | The same as the | ||
5650 | .Fl inkey | ||
5651 | command line option. | ||
5652 | .It Cm default_policy | ||
5653 | The default policy to use when the request does not mandate any policy. | ||
5654 | The same as the | ||
5655 | .Fl policy | ||
5656 | command line option. | ||
5657 | .It Cm other_policies | ||
5658 | Comma separated list of policies that are also acceptable by the TSA | ||
5659 | and used only if the request explicitly specifies one of them. | ||
5660 | .It Cm digests | ||
5661 | The list of message digest algorithms that the TSA accepts. | ||
5662 | At least one algorithm must be specified. | ||
5663 | This parameter is mandatory. | ||
5664 | .It Cm accuracy | ||
5665 | The accuracy of the time source of the TSA in seconds, milliseconds | ||
5666 | and microseconds. | ||
5667 | For example, secs:1, millisecs:500, microsecs:100. | ||
5668 | If any of the components is missing, | ||
5669 | zero is assumed for that field. | ||
5670 | .It Cm clock_precision_digits | ||
5671 | The maximum number of digits, which represent the fraction of seconds, | ||
5672 | that need to be included in the time field. | ||
5673 | The trailing zeroes must be removed from the time, | ||
5674 | so there might actually be fewer digits | ||
5675 | or no fraction of seconds at all. | ||
5676 | The maximum value is 6; | ||
5677 | the default is 0. | ||
5678 | .It Cm ordering | ||
5679 | If this option is yes, | ||
5680 | the responses generated by this TSA can always be ordered, | ||
5681 | even if the time difference between two responses is less | ||
5682 | than the sum of their accuracies. | ||
5683 | The default is no. | ||
5684 | .It Cm tsa_name | ||
5685 | Set this option to yes if the subject name of the TSA must be included in | ||
5686 | the TSA name field of the response. | ||
5687 | The default is no. | ||
5688 | .It Cm ess_cert_id_chain | ||
5689 | The SignedData objects created by the TSA always contain the | ||
5690 | certificate identifier of the signing certificate in a signed | ||
5691 | attribute (see RFC 2634, Enhanced Security Services). | ||
5692 | If this option is set to yes and either the | ||
5693 | .Cm certs | ||
5694 | variable or the | ||
5695 | .Fl chain | ||
5696 | option is specified then the certificate identifiers of the chain will also | ||
5697 | be included in the SigningCertificate signed attribute. | ||
5698 | If this variable is set to no, | ||
5699 | only the signing certificate identifier is included. | ||
5700 | The default is no. | ||
5701 | .El | ||
5702 | .Tg verify | ||
5703 | .Sh VERIFY | ||
5704 | .Bl -hang -width "openssl verify" | ||
5705 | .It Nm openssl verify | ||
5706 | .Bk -words | ||
5707 | .Op Fl CAfile Ar file | ||
5708 | .Op Fl CApath Ar directory | ||
5709 | .Op Fl check_ss_sig | ||
5710 | .Op Fl CRLfile Ar file | ||
5711 | .Op Fl crl_check | ||
5712 | .Op Fl crl_check_all | ||
5713 | .Op Fl explicit_policy | ||
5714 | .Op Fl extended_crl | ||
5715 | .Op Fl help | ||
5716 | .Op Fl ignore_critical | ||
5717 | .Op Fl inhibit_any | ||
5718 | .Op Fl inhibit_map | ||
5719 | .Op Fl issuer_checks | ||
5720 | .Op Fl legacy_verify | ||
5721 | .Op Fl policy_check | ||
5722 | .Op Fl purpose Ar purpose | ||
5723 | .Op Fl trusted Ar file | ||
5724 | .Op Fl untrusted Ar file | ||
5725 | .Op Fl verbose | ||
5726 | .Op Fl x509_strict | ||
5727 | .Op Ar certificates | ||
5728 | .Ek | ||
5729 | .El | ||
5730 | .Pp | ||
5731 | The | ||
5732 | .Nm verify | ||
5733 | command verifies certificate chains. | ||
5734 | .Pp | ||
5735 | The options are as follows: | ||
5736 | .Bl -tag -width Ds | ||
5737 | .It Fl CAfile Ar file | ||
5738 | A | ||
5739 | .Ar file | ||
5740 | of trusted certificates. | ||
5741 | The | ||
5742 | .Ar file | ||
5743 | should contain multiple certificates in PEM format, concatenated together. | ||
5744 | .It Fl CApath Ar directory | ||
5745 | A | ||
5746 | .Ar directory | ||
5747 | of trusted certificates. | ||
5748 | The certificates, or symbolic links to them, | ||
5749 | should have names of the form | ||
5750 | .Ar hash Ns .0 , | ||
5751 | where | ||
5752 | .Ar hash | ||
5753 | is the hashed certificate subject name | ||
5754 | (see the | ||
5755 | .Fl hash | ||
5756 | option of the | ||
5757 | .Nm x509 | ||
5758 | utility). | ||
5759 | .It Fl check_ss_sig | ||
5760 | Verify the signature on the self-signed root CA. | ||
5761 | This is disabled by default | ||
5762 | because it doesn't add any security. | ||
5763 | .It Fl CRLfile Ar file | ||
5764 | The | ||
5765 | .Ar file | ||
5766 | should contain one or more CRLs in PEM format. | ||
5767 | .It Fl crl_check | ||
5768 | Check end entity certificate validity by attempting to look up a valid CRL. | ||
5769 | If a valid CRL cannot be found, an error occurs. | ||
5770 | .It Fl crl_check_all | ||
5771 | Check the validity of all certificates in the chain by attempting | ||
5772 | to look up valid CRLs. | ||
5773 | .It Fl explicit_policy | ||
5774 | Set policy variable require-explicit-policy (RFC 3280). | ||
5775 | .It Fl extended_crl | ||
5776 | Enable extended CRL features such as indirect CRLs and alternate CRL | ||
5777 | signing keys. | ||
5778 | .It Fl help | ||
5779 | Print a usage message. | ||
5780 | .It Fl ignore_critical | ||
5781 | Ignore critical extensions instead of rejecting the certificate. | ||
5782 | .It Fl inhibit_any | ||
5783 | Set policy variable inhibit-any-policy (RFC 3280). | ||
5784 | .It Fl inhibit_map | ||
5785 | Set policy variable inhibit-policy-mapping (RFC 3280). | ||
5786 | .It Fl issuer_checks | ||
5787 | Print diagnostics relating to searches for the issuer certificate | ||
5788 | of the current certificate | ||
5789 | showing why each candidate issuer certificate was rejected. | ||
5790 | The presence of rejection messages | ||
5791 | does not itself imply that anything is wrong: | ||
5792 | during the normal verify process several rejections may take place. | ||
5793 | .It Fl legacy_verify | ||
5794 | Use the legacy X.509 certificate chain verification code. | ||
5795 | .It Fl policy_check | ||
5796 | Enable certificate policy processing. | ||
5797 | .It Fl purpose Ar purpose | ||
5798 | The intended use for the certificate. | ||
5799 | Without this option no chain verification will be done. | ||
5800 | Currently accepted uses are | ||
5801 | .Cm sslclient , sslserver , | ||
5802 | .Cm nssslserver , smimesign , | ||
5803 | .Cm smimeencrypt , crlsign , | ||
5804 | .Cm any , | ||
5805 | and | ||
5806 | .Cm ocsphelper . | ||
5807 | .It Fl trusted Ar file | ||
5808 | A | ||
5809 | .Ar file | ||
5810 | of trusted certificates. | ||
5811 | The | ||
5812 | .Ar file | ||
5813 | should contain multiple certificates. | ||
5814 | .It Fl untrusted Ar file | ||
5815 | A | ||
5816 | .Ar file | ||
5817 | of untrusted certificates. | ||
5818 | The | ||
5819 | .Ar file | ||
5820 | should contain multiple certificates. | ||
5821 | .It Fl verbose | ||
5822 | Print extra information about the operations being performed. | ||
5823 | .It Fl x509_strict | ||
5824 | Disable workarounds for broken certificates which have to be disabled | ||
5825 | for strict X.509 compliance. | ||
5826 | .It Ar certificates | ||
5827 | One or more PEM | ||
5828 | .Ar certificates | ||
5829 | to verify. | ||
5830 | If no certificate files are included, an attempt is made to read | ||
5831 | a certificate from standard input. | ||
5832 | If the first certificate filename begins with a dash, | ||
5833 | use a lone dash to mark the last option. | ||
5834 | .El | ||
5835 | .Pp | ||
5836 | The | ||
5837 | .Nm verify | ||
5838 | program uses the same functions as the internal SSL and S/MIME verification, | ||
5839 | with one crucial difference: | ||
5840 | wherever possible an attempt is made to continue after an error, | ||
5841 | whereas normally the verify operation would halt on the first error. | ||
5842 | This allows all the problems with a certificate chain to be determined. | ||
5843 | .Pp | ||
5844 | The verify operation consists of a number of separate steps. | ||
5845 | Firstly a certificate chain is built up starting from the supplied certificate | ||
5846 | and ending in the root CA. | ||
5847 | It is an error if the whole chain cannot be built up. | ||
5848 | The chain is built up by looking up the issuer's certificate of the current | ||
5849 | certificate. | ||
5850 | If a certificate is found which is its own issuer, it is assumed | ||
5851 | to be the root CA. | ||
5852 | .Pp | ||
5853 | All certificates whose subject name matches the issuer name | ||
5854 | of the current certificate are subject to further tests. | ||
5855 | The relevant authority key identifier components of the current certificate | ||
5856 | (if present) must match the subject key identifier (if present) | ||
5857 | and issuer and serial number of the candidate issuer; | ||
5858 | in addition the | ||
5859 | .Cm keyUsage | ||
5860 | extension of the candidate issuer (if present) must permit certificate signing. | ||
5861 | .Pp | ||
5862 | The lookup first looks in the list of untrusted certificates and if no match | ||
5863 | is found the remaining lookups are from the trusted certificates. | ||
5864 | The root CA is always looked up in the trusted certificate list: | ||
5865 | if the certificate to verify is a root certificate, | ||
5866 | then an exact match must be found in the trusted list. | ||
5867 | .Pp | ||
5868 | The second operation is to check every untrusted certificate's extensions for | ||
5869 | consistency with the supplied purpose. | ||
5870 | If the | ||
5871 | .Fl purpose | ||
5872 | option is not included, then no checks are done. | ||
5873 | The supplied or | ||
5874 | .Qq leaf | ||
5875 | certificate must have extensions compatible with the supplied purpose | ||
5876 | and all other certificates must also be valid CA certificates. | ||
5877 | The precise extensions required are described in more detail in | ||
5878 | the | ||
5879 | .Nm X509 | ||
5880 | section below. | ||
5881 | .Pp | ||
5882 | The third operation is to check the trust settings on the root CA. | ||
5883 | The root CA should be trusted for the supplied purpose. | ||
5884 | A certificate with no trust settings is considered to be valid for | ||
5885 | all purposes. | ||
5886 | .Pp | ||
5887 | The final operation is to check the validity of the certificate chain. | ||
5888 | The validity period is checked against the current system time and the | ||
5889 | .Cm notBefore | ||
5890 | and | ||
5891 | .Cm notAfter | ||
5892 | dates in the certificate. | ||
5893 | The certificate signatures are also checked at this point. | ||
5894 | .Pp | ||
5895 | If all operations complete successfully, the certificate is considered | ||
5896 | valid. | ||
5897 | If any operation fails then the certificate is not valid. | ||
5898 | When a verify operation fails, the output messages can be somewhat cryptic. | ||
5899 | The general form of the error message is: | ||
5900 | .Bd -literal | ||
5901 | server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit) | ||
5902 | error 24 at 1 depth lookup:invalid CA certificate | ||
5903 | .Ed | ||
5904 | .Pp | ||
5905 | The first line contains the name of the certificate being verified, followed by | ||
5906 | the subject name of the certificate. | ||
5907 | The second line contains the error number as defined by the | ||
5908 | .Dv X509_V_ERR_* | ||
5909 | constants in | ||
5910 | .In openssl/x509_vfy.h , | ||
5911 | the associated error message documented in | ||
5912 | .Xr X509_STORE_CTX_get_error 3 , | ||
5913 | and the depth. | ||
5914 | The depth is the number of the certificate being verified when a | ||
5915 | problem was detected starting with zero for the certificate being verified | ||
5916 | itself, then 1 for the CA that signed the certificate and so on. | ||
5917 | .Tg version | ||
5918 | .Sh VERSION | ||
5919 | .Nm openssl version | ||
5920 | .Op Fl abdfpv | ||
5921 | .Pp | ||
5922 | The | ||
5923 | .Nm version | ||
5924 | command is used to print out version information about | ||
5925 | .Nm openssl . | ||
5926 | .Pp | ||
5927 | The options are as follows: | ||
5928 | .Bl -tag -width Ds | ||
5929 | .It Fl a | ||
5930 | All information: this is the same as setting all the other flags. | ||
5931 | .It Fl b | ||
5932 | The date the current version of | ||
5933 | .Nm openssl | ||
5934 | was built. | ||
5935 | .It Fl d | ||
5936 | .Ev OPENSSLDIR | ||
5937 | setting. | ||
5938 | .It Fl f | ||
5939 | Compilation flags. | ||
5940 | .It Fl p | ||
5941 | Platform setting. | ||
5942 | .It Fl v | ||
5943 | The current | ||
5944 | .Nm openssl | ||
5945 | version. | ||
5946 | .El | ||
5947 | .Tg x509 | ||
5948 | .Sh X509 | ||
5949 | .Bl -hang -width "openssl x509" | ||
5950 | .It Nm openssl x509 | ||
5951 | .Bk -words | ||
5952 | .Op Fl addreject Ar arg | ||
5953 | .Op Fl addtrust Ar arg | ||
5954 | .Op Fl alias | ||
5955 | .Op Fl CA Ar file | ||
5956 | .Op Fl CAcreateserial | ||
5957 | .Op Fl CAform Cm der | pem | ||
5958 | .Op Fl CAkey Ar file | ||
5959 | .Op Fl CAkeyform Cm der | pem | ||
5960 | .Op Fl CAserial Ar file | ||
5961 | .Op Fl certopt Ar option | ||
5962 | .Op Fl checkend Ar arg | ||
5963 | .Op Fl clrext | ||
5964 | .Op Fl clrreject | ||
5965 | .Op Fl clrtrust | ||
5966 | .Op Fl dates | ||
5967 | .Op Fl days Ar arg | ||
5968 | .Op Fl email | ||
5969 | .Op Fl enddate | ||
5970 | .Op Fl extensions Ar section | ||
5971 | .Op Fl extfile Ar file | ||
5972 | .Op Fl fingerprint | ||
5973 | .Op Fl force_pubkey Ar key | ||
5974 | .Op Fl hash | ||
5975 | .Op Fl in Ar file | ||
5976 | .Op Fl inform Cm der | net | pem | ||
5977 | .Op Fl issuer | ||
5978 | .Op Fl issuer_hash | ||
5979 | .Op Fl issuer_hash_old | ||
5980 | .Op Fl keyform Cm der | pem | ||
5981 | .Op Fl md5 | sha1 | ||
5982 | .Op Fl modulus | ||
5983 | .Op Fl multivalue-rdn | ||
5984 | .Op Fl nameopt Ar option | ||
5985 | .Op Fl new | ||
5986 | .Op Fl next_serial | ||
5987 | .Op Fl noout | ||
5988 | .Op Fl ocsp_uri | ||
5989 | .Op Fl ocspid | ||
5990 | .Op Fl out Ar file | ||
5991 | .Op Fl outform Cm der | net | pem | ||
5992 | .Op Fl passin Ar arg | ||
5993 | .Op Fl pubkey | ||
5994 | .Op Fl purpose | ||
5995 | .Op Fl req | ||
5996 | .Op Fl serial | ||
5997 | .Op Fl set_issuer Ar name | ||
5998 | .Op Fl set_serial Ar n | ||
5999 | .Op Fl set_subject Ar name | ||
6000 | .Op Fl setalias Ar arg | ||
6001 | .Op Fl signkey Ar file | ||
6002 | .Op Fl sigopt Ar nm:v | ||
6003 | .Op Fl startdate | ||
6004 | .Op Fl subject | ||
6005 | .Op Fl subject_hash | ||
6006 | .Op Fl subject_hash_old | ||
6007 | .Op Fl text | ||
6008 | .Op Fl trustout | ||
6009 | .Op Fl utf8 | ||
6010 | .Op Fl x509toreq | ||
6011 | .Ek | ||
6012 | .El | ||
6013 | .Pp | ||
6014 | The | ||
6015 | .Nm x509 | ||
6016 | command is a multi-purpose certificate utility. | ||
6017 | It can be used to display certificate information, convert certificates to | ||
6018 | various forms, sign certificate requests like a | ||
6019 | .Qq mini CA , | ||
6020 | or edit certificate trust settings. | ||
6021 | .Pp | ||
6022 | The following are x509 input, output, and general purpose options: | ||
6023 | .Bl -tag -width "XXXX" | ||
6024 | .It Fl in Ar file | ||
6025 | The input file to read from, | ||
6026 | or standard input if not specified. | ||
6027 | This option cannot be used with | ||
6028 | .Fl new . | ||
6029 | .It Fl inform Cm der | net | pem | ||
6030 | The input format. | ||
6031 | Normally, the command will expect an X.509 certificate, | ||
6032 | but this can change if other options such as | ||
6033 | .Fl in | ||
6034 | or | ||
6035 | .Fl req | ||
6036 | are present. | ||
6037 | .It Fl md5 | sha1 | ||
6038 | The digest to use. | ||
6039 | This affects any signing or display option that uses a message digest, | ||
6040 | such as the | ||
6041 | .Fl fingerprint , signkey , | ||
6042 | and | ||
6043 | .Fl CA | ||
6044 | options. | ||
6045 | If not specified, MD5 is used. | ||
6046 | SHA1 is always used with DSA keys. | ||
6047 | .It Fl out Ar file | ||
6048 | The output file to write to, | ||
6049 | or standard output if none is specified. | ||
6050 | .It Fl outform Cm der | net | pem | ||
6051 | The output format. | ||
6052 | .It Fl passin Ar arg | ||
6053 | The key password source. | ||
6054 | .El | ||
6055 | .Pp | ||
6056 | The following are x509 display options: | ||
6057 | .Bl -tag -width "XXXX" | ||
6058 | .It Fl certopt Ar option | ||
6059 | Customise the output format used with | ||
6060 | .Fl text , | ||
6061 | either using a list of comma-separated options or by specifying | ||
6062 | .Fl certopt | ||
6063 | multiple times. | ||
6064 | The default behaviour is to print all fields. | ||
6065 | The options are as follows: | ||
6066 | .Pp | ||
6067 | .Bl -tag -width "no_extensions" -offset indent -compact | ||
6068 | .It Cm ca_default | ||
6069 | Equivalent to | ||
6070 | .Cm no_issuer , no_pubkey , no_header , | ||
6071 | .Cm no_version , no_sigdump , | ||
6072 | and | ||
6073 | .Cm no_signame . | ||
6074 | .It Cm compatible | ||
6075 | Equivalent to no output options at all. | ||
6076 | .It Cm ext_default | ||
6077 | Print unsupported certificate extensions. | ||
6078 | .It Cm ext_dump | ||
6079 | Hex dump unsupported extensions. | ||
6080 | .It Cm ext_error | ||
6081 | Print an error message for unsupported certificate extensions. | ||
6082 | .It Cm ext_parse | ||
6083 | ASN.1 parse unsupported extensions. | ||
6084 | .It Cm no_aux | ||
6085 | Do not print certificate trust information. | ||
6086 | .It Cm no_extensions | ||
6087 | Do not print X509V3 extensions. | ||
6088 | .It Cm no_header | ||
6089 | Do not print header (Certificate and Data) information. | ||
6090 | .It Cm no_issuer | ||
6091 | Do not print the issuer name. | ||
6092 | .It Cm no_pubkey | ||
6093 | Do not print the public key. | ||
6094 | .It Cm no_serial | ||
6095 | Do not print the serial number. | ||
6096 | .It Cm no_sigdump | ||
6097 | Do not give a hexadecimal dump of the certificate signature. | ||
6098 | .It Cm no_signame | ||
6099 | Do not print the signature algorithm used. | ||
6100 | .It Cm no_subject | ||
6101 | Do not print the subject name. | ||
6102 | .It Cm no_validity | ||
6103 | Do not print the | ||
6104 | .Cm notBefore | ||
6105 | and | ||
6106 | .Cm notAfter | ||
6107 | (validity) fields. | ||
6108 | .It Cm no_version | ||
6109 | Do not print the version number. | ||
6110 | .El | ||
6111 | .It Fl dates | ||
6112 | Print the start and expiry date of a certificate. | ||
6113 | .It Fl email | ||
6114 | Output the email addresses, if any. | ||
6115 | .It Fl enddate | ||
6116 | Print the expiry date of the certificate; that is, the | ||
6117 | .Cm notAfter | ||
6118 | date. | ||
6119 | .It Fl fingerprint | ||
6120 | Print the digest of the DER-encoded version of the whole certificate. | ||
6121 | .It Fl hash | ||
6122 | A synonym for | ||
6123 | .Fl subject_hash . | ||
6124 | .It Fl issuer | ||
6125 | Print the issuer name. | ||
6126 | .It Fl issuer_hash | ||
6127 | Print the hash of the certificate issuer name. | ||
6128 | .It Fl issuer_hash_old | ||
6129 | Print the hash of the certificate issuer name | ||
6130 | using the older algorithm as used by | ||
6131 | .Nm openssl | ||
6132 | versions before 1.0.0. | ||
6133 | .It Fl modulus | ||
6134 | Print the value of the modulus of the public key contained in the certificate. | ||
6135 | .It Fl multivalue-rdn | ||
6136 | This option causes the | ||
6137 | .Fl subj | ||
6138 | argument to be interpreted with full support for multivalued RDNs, | ||
6139 | for example | ||
6140 | .Qq "/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe" . | ||
6141 | If | ||
6142 | .Fl multivalue-rdn | ||
6143 | is not used, the UID value is set to | ||
6144 | .Qq "123456+CN=John Doe" . | ||
6145 | .It Fl nameopt Ar option | ||
6146 | Customise how the subject or issuer names are displayed, | ||
6147 | either using a list of comma-separated options or by specifying | ||
6148 | .Fl nameopt | ||
6149 | multiple times. | ||
6150 | The default behaviour is to use the | ||
6151 | .Cm oneline | ||
6152 | format. | ||
6153 | The options, | ||
6154 | which can be preceded by a dash to turn them off, | ||
6155 | are as follows: | ||
6156 | .Bl -tag -width "XXXX" | ||
6157 | .It Cm align | ||
6158 | Align field values for a more readable output. | ||
6159 | Only usable with | ||
6160 | .Ar sep_multiline . | ||
6161 | .It Cm compat | ||
6162 | Use the old format, | ||
6163 | equivalent to specifying no options at all. | ||
6164 | .It Cm dn_rev | ||
6165 | Reverse the fields of the DN, as required by RFC 2253. | ||
6166 | As a side effect, this also reverses the order of multiple AVAs. | ||
6167 | .It Cm dump_all | ||
6168 | Dump all fields. | ||
6169 | When used with | ||
6170 | .Ar dump_der , | ||
6171 | it allows the DER encoding of the structure to be unambiguously determined. | ||
6172 | .It Cm dump_der | ||
6173 | Any fields that need to be hexdumped are | ||
6174 | dumped using the DER encoding of the field. | ||
6175 | Otherwise just the content octets will be displayed. | ||
6176 | Both options use the RFC 2253 #XXXX... format. | ||
6177 | .It Cm dump_nostr | ||
6178 | Dump non-character string types | ||
6179 | (for example OCTET STRING); | ||
6180 | usually, non-character string types are displayed | ||
6181 | as though each content octet represents a single character. | ||
6182 | .It Cm dump_unknown | ||
6183 | Dump any field whose OID is not recognised by | ||
6184 | .Nm openssl . | ||
6185 | .It Cm esc_2253 | ||
6186 | Escape the | ||
6187 | .Qq special | ||
6188 | characters required by RFC 2253 in a field that is | ||
6189 | .Dq \& ,+"<>; . | ||
6190 | Additionally, | ||
6191 | .Sq # | ||
6192 | is escaped at the beginning of a string | ||
6193 | and a space character at the beginning or end of a string. | ||
6194 | .It Cm esc_ctrl | ||
6195 | Escape control characters. | ||
6196 | That is, those with ASCII values less than 0x20 (space) | ||
6197 | and the delete (0x7f) character. | ||
6198 | They are escaped using the RFC 2253 \eXX notation (where XX are two hex | ||
6199 | digits representing the character value). | ||
6200 | .It Cm esc_msb | ||
6201 | Escape characters with the MSB set; that is, with ASCII values larger than | ||
6202 | 127. | ||
6203 | .It Cm multiline | ||
6204 | A multiline format. | ||
6205 | Equivalent to | ||
6206 | .Cm esc_ctrl , esc_msb , sep_multiline , | ||
6207 | .Cm space_eq , lname , | ||
6208 | and | ||
6209 | .Cm align . | ||
6210 | .It Cm no_type | ||
6211 | Do not attempt to interpret multibyte characters. | ||
6212 | That is, content octets are merely dumped as though one octet | ||
6213 | represents each character. | ||
6214 | This is useful for diagnostic purposes | ||
6215 | but results in rather odd looking output. | ||
6216 | .It Cm nofname , sname , lname , oid | ||
6217 | Alter how the field name is displayed: | ||
6218 | .Cm nofname | ||
6219 | does not display the field at all; | ||
6220 | .Cm sname | ||
6221 | uses the short name form (CN for | ||
6222 | .Cm commonName , | ||
6223 | for example); | ||
6224 | .Cm lname | ||
6225 | uses the long form. | ||
6226 | .Cm oid | ||
6227 | represents the OID in numerical form and is useful for diagnostic purpose. | ||
6228 | .It Cm oneline | ||
6229 | A one line format which is more readable than | ||
6230 | .Cm RFC2253 . | ||
6231 | Equivalent to | ||
6232 | .Cm esc_2253 , esc_ctrl , esc_msb , utf8 , | ||
6233 | .Cm dump_nostr , dump_der , use_quote , sep_comma_plus_spc , | ||
6234 | .Cm space_eq , | ||
6235 | and | ||
6236 | .Cm sname . | ||
6237 | .It Cm RFC2253 | ||
6238 | Displays names compatible with RFC 2253. | ||
6239 | Equivalent to | ||
6240 | .Cm esc_2253 , esc_ctrl , | ||
6241 | .Cm esc_msb , utf8 , dump_nostr , dump_unknown , | ||
6242 | .Cm dump_der , sep_comma_plus , dn_rev , | ||
6243 | and | ||
6244 | .Cm sname . | ||
6245 | .It Cm sep_comma_plus , sep_comma_plus_space , sep_semi_plus_space , sep_multiline | ||
6246 | Determine the field separators: | ||
6247 | the first character is between RDNs and the second between multiple AVAs | ||
6248 | (multiple AVAs are very rare and their use is discouraged). | ||
6249 | The options ending in | ||
6250 | .Qq space | ||
6251 | additionally place a space after the separator to make it more readable. | ||
6252 | .Cm sep_multiline | ||
6253 | uses a linefeed character for the RDN separator and a spaced | ||
6254 | .Sq + | ||
6255 | for the AVA separator, | ||
6256 | as well as indenting the fields by four characters. | ||
6257 | If no field separator is specified then | ||
6258 | .Cm sep_comma_plus_space | ||
6259 | is used by default. | ||
6260 | .It Cm show_type | ||
6261 | Show the type of the ASN.1 character string. | ||
6262 | The type precedes the field contents. | ||
6263 | For example | ||
6264 | .Qq BMPSTRING: Hello World . | ||
6265 | .It Cm space_eq | ||
6266 | Place spaces round the | ||
6267 | .Sq = | ||
6268 | character which follows the field name. | ||
6269 | .It Cm use_quote | ||
6270 | Escape some characters by surrounding the whole string with | ||
6271 | .Sq \&" | ||
6272 | characters. | ||
6273 | Without the option, all escaping is done with the | ||
6274 | .Sq \e | ||
6275 | character. | ||
6276 | .It Cm utf8 | ||
6277 | Convert all strings to UTF8 format first, as required by RFC 2253. | ||
6278 | On a UTF8 compatible terminal, | ||
6279 | the use of this option (and not setting | ||
6280 | .Cm esc_msb ) | ||
6281 | may result in the correct display of multibyte characters. | ||
6282 | Usually, multibyte characters larger than 0xff | ||
6283 | are represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | ||
6284 | for 32 bits, | ||
6285 | and any UTF8Strings are converted to their character form first. | ||
6286 | .El | ||
6287 | .It Fl next_serial | ||
6288 | Print the next serial number. | ||
6289 | .It Fl noout | ||
6290 | Do not output the encoded version of the request. | ||
6291 | .It Fl ocsp_uri | ||
6292 | Print the OCSP responder addresses, if any. | ||
6293 | .It Fl ocspid | ||
6294 | Print OCSP hash values for the subject name and public key. | ||
6295 | .It Fl pubkey | ||
6296 | Print the public key. | ||
6297 | .It Fl serial | ||
6298 | Print the certificate serial number. | ||
6299 | .It Fl sigopt Ar nm:v | ||
6300 | Pass options to the signature algorithm during sign or certify operations. | ||
6301 | The names and values of these options are algorithm-specific. | ||
6302 | .It Fl startdate | ||
6303 | Print the start date of the certificate; that is, the | ||
6304 | .Cm notBefore | ||
6305 | date. | ||
6306 | .It Fl subject | ||
6307 | Print the subject name. | ||
6308 | .It Fl subject_hash | ||
6309 | Print the hash of the certificate subject name. | ||
6310 | This is used in | ||
6311 | .Nm openssl | ||
6312 | to form an index to allow certificates in a directory to be looked up | ||
6313 | by subject name. | ||
6314 | .It Fl subject_hash_old | ||
6315 | Print the hash of the certificate subject name | ||
6316 | using the older algorithm as used by | ||
6317 | .Nm openssl | ||
6318 | versions before 1.0.0. | ||
6319 | .It Fl text | ||
6320 | Print the full certificate in text form. | ||
6321 | .El | ||
6322 | .Pp | ||
6323 | A trusted certificate is a certificate which has several | ||
6324 | additional pieces of information attached to it such as the permitted | ||
6325 | and prohibited uses of the certificate and an alias. | ||
6326 | When a certificate is being verified, at least one certificate must be trusted. | ||
6327 | By default, a trusted certificate must be stored locally and be a root CA. | ||
6328 | The following are x509 trust settings options: | ||
6329 | .Bl -tag -width "XXXX" | ||
6330 | .It Fl addreject Ar arg | ||
6331 | Add a prohibited use. | ||
6332 | Accepts the same values as the | ||
6333 | .Fl addtrust | ||
6334 | option. | ||
6335 | .It Fl addtrust Ar arg | ||
6336 | Add a trusted certificate use. | ||
6337 | Any object name can be used here, but currently only | ||
6338 | .Cm clientAuth | ||
6339 | (SSL client use), | ||
6340 | .Cm serverAuth | ||
6341 | (SSL server use), | ||
6342 | and | ||
6343 | .Cm emailProtection | ||
6344 | (S/MIME email) are used. | ||
6345 | .It Fl alias | ||
6346 | Output the certificate alias. | ||
6347 | .It Fl clrreject | ||
6348 | Clear all the prohibited or rejected uses of the certificate. | ||
6349 | .It Fl clrtrust | ||
6350 | Clear all the permitted or trusted uses of the certificate. | ||
6351 | .It Fl purpose | ||
6352 | Perform tests on the certificate extensions. | ||
6353 | The same code is used when verifying untrusted certificates in chains, | ||
6354 | so this section is useful if a chain is rejected by the verify code. | ||
6355 | .Pp | ||
6356 | The | ||
6357 | .Cm basicConstraints | ||
6358 | extension CA flag is used to determine whether the | ||
6359 | certificate can be used as a CA. | ||
6360 | If the CA flag is true, it is a CA; | ||
6361 | if the CA flag is false, it is not a CA. | ||
6362 | All CAs should have the CA flag set to true. | ||
6363 | .Pp | ||
6364 | If the | ||
6365 | .Cm basicConstraints | ||
6366 | extension is absent, then the certificate is | ||
6367 | considered to be a possible CA; | ||
6368 | other extensions are checked according to the intended use of the certificate. | ||
6369 | A warning is given in this case because the certificate should really not | ||
6370 | be regarded as a CA. | ||
6371 | However it is allowed to be a CA to work around some broken software. | ||
6372 | .Pp | ||
6373 | If the certificate is a V1 certificate | ||
6374 | (and thus has no extensions) and it is self-signed, | ||
6375 | it is also assumed to be a CA but a warning is again given. | ||
6376 | This is to work around the problem of Verisign roots | ||
6377 | which are V1 self-signed certificates. | ||
6378 | .Pp | ||
6379 | If the | ||
6380 | .Cm keyUsage | ||
6381 | extension is present, then additional restraints are | ||
6382 | made on the uses of the certificate. | ||
6383 | A CA certificate must have the | ||
6384 | .Cm keyCertSign | ||
6385 | bit set if the | ||
6386 | .Cm keyUsage | ||
6387 | extension is present. | ||
6388 | .Pp | ||
6389 | The extended key usage extension places additional restrictions on the | ||
6390 | certificate uses. | ||
6391 | If this extension is present, whether critical or not, | ||
6392 | the key can only be used for the purposes specified. | ||
6393 | .Pp | ||
6394 | A complete description of each test is given below. | ||
6395 | The comments about | ||
6396 | .Cm basicConstraints | ||
6397 | and | ||
6398 | .Cm keyUsage | ||
6399 | and V1 certificates above apply to all CA certificates. | ||
6400 | .Bl -tag -width "XXXX" | ||
6401 | .It SSL Client | ||
6402 | The extended key usage extension must be absent or include the | ||
6403 | web client authentication OID. | ||
6404 | .Cm keyUsage | ||
6405 | must be absent or it must have the | ||
6406 | .Cm digitalSignature | ||
6407 | bit set. | ||
6408 | The Netscape certificate type must be absent | ||
6409 | or it must have the SSL client bit set. | ||
6410 | .It SSL Client CA | ||
6411 | The extended key usage extension must be absent or include the | ||
6412 | web client authentication OID. | ||
6413 | The Netscape certificate type must be absent | ||
6414 | or it must have the SSL CA bit set: | ||
6415 | this is used as a workaround if the | ||
6416 | .Cm basicConstraints | ||
6417 | extension is absent. | ||
6418 | .It SSL Server | ||
6419 | The extended key usage extension must be absent or include the | ||
6420 | web server authentication and/or one of the SGC OIDs. | ||
6421 | .Cm keyUsage | ||
6422 | must be absent or it must have the | ||
6423 | .Cm digitalSignature | ||
6424 | set, the | ||
6425 | .Cm keyEncipherment | ||
6426 | set, or both bits set. | ||
6427 | The Netscape certificate type must be absent or have the SSL server bit set. | ||
6428 | .It SSL Server CA | ||
6429 | The extended key usage extension must be absent or include the | ||
6430 | web server authentication and/or one of the SGC OIDs. | ||
6431 | The Netscape certificate type must be absent or the SSL CA bit must be set: | ||
6432 | this is used as a workaround if the | ||
6433 | .Cm basicConstraints | ||
6434 | extension is absent. | ||
6435 | .It Netscape SSL Server | ||
6436 | For Netscape SSL clients to connect to an SSL server; it must have the | ||
6437 | .Cm keyEncipherment | ||
6438 | bit set if the | ||
6439 | .Cm keyUsage | ||
6440 | extension is present. | ||
6441 | This isn't always valid because some cipher suites use the key for | ||
6442 | digital signing. | ||
6443 | Otherwise it is the same as a normal SSL server. | ||
6444 | .It Common S/MIME Client Tests | ||
6445 | The extended key usage extension must be absent or include the | ||
6446 | email protection OID. | ||
6447 | The Netscape certificate type must be absent or should have the S/MIME bit set. | ||
6448 | If the S/MIME bit is not set in Netscape certificate type, then the SSL | ||
6449 | client bit is tolerated as an alternative but a warning is shown: | ||
6450 | this is because some Verisign certificates don't set the S/MIME bit. | ||
6451 | .It S/MIME Signing | ||
6452 | In addition to the common S/MIME client tests, the | ||
6453 | .Cm digitalSignature | ||
6454 | bit must be set if the | ||
6455 | .Cm keyUsage | ||
6456 | extension is present. | ||
6457 | .It S/MIME Encryption | ||
6458 | In addition to the common S/MIME tests, the | ||
6459 | .Cm keyEncipherment | ||
6460 | bit must be set if the | ||
6461 | .Cm keyUsage | ||
6462 | extension is present. | ||
6463 | .It S/MIME CA | ||
6464 | The extended key usage extension must be absent or include the | ||
6465 | email protection OID. | ||
6466 | The Netscape certificate type must be absent | ||
6467 | or must have the S/MIME CA bit set: | ||
6468 | this is used as a workaround if the | ||
6469 | .Cm basicConstraints | ||
6470 | extension is absent. | ||
6471 | .It CRL Signing | ||
6472 | The | ||
6473 | .Cm keyUsage | ||
6474 | extension must be absent or it must have the CRL signing bit set. | ||
6475 | .It CRL Signing CA | ||
6476 | The normal CA tests apply, except the | ||
6477 | .Cm basicConstraints | ||
6478 | extension must be present. | ||
6479 | .El | ||
6480 | .It Fl setalias Ar arg | ||
6481 | Set the alias of the certificate, | ||
6482 | allowing the certificate to be referred to using a nickname, | ||
6483 | such as | ||
6484 | .Qq Steve's Certificate . | ||
6485 | .It Fl trustout | ||
6486 | Output a trusted certificate | ||
6487 | (the default if any trust settings are modified). | ||
6488 | An ordinary or trusted certificate can be input, but by default an ordinary | ||
6489 | certificate is output and any trust settings are discarded. | ||
6490 | .El | ||
6491 | .Pp | ||
6492 | The | ||
6493 | .Nm x509 | ||
6494 | utility can be used to sign certificates and requests: | ||
6495 | it can thus behave like a mini CA. | ||
6496 | The following are x509 signing options: | ||
6497 | .Bl -tag -width "XXXX" | ||
6498 | .It Fl CA Ar file | ||
6499 | The CA certificate to be used for signing. | ||
6500 | When this option is present, | ||
6501 | .Nm x509 | ||
6502 | behaves like a mini CA. | ||
6503 | The input file is signed by the CA using this option; | ||
6504 | that is, its issuer name is set to the subject name of the CA and it is | ||
6505 | digitally signed using the CA's private key. | ||
6506 | .Pp | ||
6507 | This option is normally combined with the | ||
6508 | .Fl req | ||
6509 | option. | ||
6510 | Without the | ||
6511 | .Fl req | ||
6512 | option, the input is a certificate which must be self-signed. | ||
6513 | .It Fl CAcreateserial | ||
6514 | Create the CA serial number file if it does not exist | ||
6515 | instead of generating an error. | ||
6516 | The file will contain the serial number | ||
6517 | .Sq 02 | ||
6518 | and the certificate being signed will have | ||
6519 | .Sq 1 | ||
6520 | as its serial number. | ||
6521 | .It Fl CAform Cm der | pem | ||
6522 | The format of the CA certificate file. | ||
6523 | The default is | ||
6524 | .Cm pem . | ||
6525 | .It Fl CAkey Ar file | ||
6526 | Set the CA private key to sign a certificate with. | ||
6527 | Otherwise it is assumed that the CA private key is present | ||
6528 | in the CA certificate file. | ||
6529 | .It Fl CAkeyform Cm der | pem | ||
6530 | The format of the CA private key. | ||
6531 | The default is | ||
6532 | .Cm pem . | ||
6533 | .It Fl CAserial Ar file | ||
6534 | Use the serial number in | ||
6535 | .Ar file | ||
6536 | to sign a certificate. | ||
6537 | The file should consist of one line containing an even number of hex digits | ||
6538 | with the serial number to use. | ||
6539 | After each use the serial number is incremented and written out | ||
6540 | to the file again. | ||
6541 | .Pp | ||
6542 | The default filename consists of the CA certificate file base name with | ||
6543 | .Pa .srl | ||
6544 | appended. | ||
6545 | For example, if the CA certificate file is called | ||
6546 | .Pa mycacert.pem , | ||
6547 | it expects to find a serial number file called | ||
6548 | .Pa mycacert.srl . | ||
6549 | .It Fl checkend Ar arg | ||
6550 | Check whether the certificate expires in the next | ||
6551 | .Ar arg | ||
6552 | seconds. | ||
6553 | If so, exit with return value 1; | ||
6554 | otherwise exit with return value 0. | ||
6555 | .It Fl clrext | ||
6556 | Delete any extensions from a certificate. | ||
6557 | This option is used when a certificate is being created from another | ||
6558 | certificate (for example with the | ||
6559 | .Fl signkey | ||
6560 | or the | ||
6561 | .Fl CA | ||
6562 | options). | ||
6563 | Normally, all extensions are retained. | ||
6564 | .It Fl days Ar arg | ||
6565 | The number of days to make a certificate valid for. | ||
6566 | The default is 30 days. | ||
6567 | .It Fl extensions Ar section | ||
6568 | The section to add certificate extensions from. | ||
6569 | If this option is not specified, the extensions should either be | ||
6570 | contained in the unnamed (default) section | ||
6571 | or the default section should contain a variable called | ||
6572 | .Qq extensions | ||
6573 | which contains the section to use. | ||
6574 | .It Fl extfile Ar file | ||
6575 | File containing certificate extensions to use. | ||
6576 | If not specified, no extensions are added to the certificate. | ||
6577 | .It Fl force_pubkey Ar key | ||
6578 | Set the public key of the certificate to the public key contained in | ||
6579 | .Ar key . | ||
6580 | .It Fl keyform Cm der | pem | ||
6581 | The format of the key file used in the | ||
6582 | .Fl force_pubkey | ||
6583 | and | ||
6584 | .Fl signkey | ||
6585 | options. | ||
6586 | .It Fl new | ||
6587 | Generate a new certificate using the subject given by | ||
6588 | .Fl set_subject | ||
6589 | and signed by | ||
6590 | .Fl signkey . | ||
6591 | If no public key is provided with | ||
6592 | .Fl force_pubkey , | ||
6593 | the resulting certificate is self-signed. | ||
6594 | This option cannot be used with | ||
6595 | .Fl in | ||
6596 | or | ||
6597 | .Fl req . | ||
6598 | .It Fl req | ||
6599 | Expect a certificate request on input instead of a certificate. | ||
6600 | This option cannot be used with | ||
6601 | .Fl new . | ||
6602 | .It Fl set_issuer Ar name | ||
6603 | The issuer name to use. | ||
6604 | .Ar name | ||
6605 | must be formatted as /type0=value0/type1=value1/type2=...; | ||
6606 | characters may be escaped by | ||
6607 | .Sq \e | ||
6608 | (backslash); | ||
6609 | no spaces are skipped. | ||
6610 | .It Fl set_serial Ar n | ||
6611 | The serial number to use. | ||
6612 | This option can be used with either the | ||
6613 | .Fl signkey | ||
6614 | or | ||
6615 | .Fl CA | ||
6616 | options. | ||
6617 | If used in conjunction with the | ||
6618 | .Fl CA | ||
6619 | option, the serial number file (as specified by the | ||
6620 | .Fl CAserial | ||
6621 | or | ||
6622 | .Fl CAcreateserial | ||
6623 | options) is not used. | ||
6624 | .Pp | ||
6625 | The serial number can be decimal or hex (if preceded by | ||
6626 | .Sq 0x ) . | ||
6627 | Negative serial numbers can also be specified but their use is not recommended. | ||
6628 | .It Fl set_subject Ar name | ||
6629 | The subject name to use. | ||
6630 | .Ar name | ||
6631 | must be formatted as /type0=value0/type1=value1/type2=...; | ||
6632 | characters may be escaped by | ||
6633 | .Sq \e | ||
6634 | (backslash); | ||
6635 | no spaces are skipped. | ||
6636 | .It Fl signkey Ar file | ||
6637 | Self-sign | ||
6638 | .Ar file | ||
6639 | using the supplied private key. | ||
6640 | .Pp | ||
6641 | If the input file is a certificate, it sets the issuer name to the | ||
6642 | subject name (i.e. makes it self-signed), | ||
6643 | changes the public key to the supplied value, | ||
6644 | and changes the start and end dates. | ||
6645 | The start date is set to the current time and the end date is set to | ||
6646 | a value determined by the | ||
6647 | .Fl days | ||
6648 | option. | ||
6649 | Any certificate extensions are retained unless the | ||
6650 | .Fl clrext | ||
6651 | option is supplied. | ||
6652 | .Pp | ||
6653 | If the input is a certificate request, a self-signed certificate | ||
6654 | is created using the supplied private key using the subject name in | ||
6655 | the request. | ||
6656 | .It Fl utf8 | ||
6657 | Interpret field values read from a terminal or obtained from a configuration | ||
6658 | file as UTF-8 strings. | ||
6659 | By default, they are interpreted as ASCII. | ||
6660 | .It Fl x509toreq | ||
6661 | Convert a certificate into a certificate request. | ||
6662 | The | ||
6663 | .Fl signkey | ||
6664 | option is used to pass the required private key. | ||
6665 | .El | ||
6666 | .Sh COMMON NOTATION | ||
6667 | Several commands share a common syntax, | ||
6668 | as detailed below. | ||
6669 | .Pp | ||
6670 | Password arguments, typically specified using | ||
6671 | .Fl passin | ||
6672 | and | ||
6673 | .Fl passout | ||
6674 | for input and output passwords, | ||
6675 | allow passwords to be obtained from a variety of sources. | ||
6676 | Both of these options take a single argument, described below. | ||
6677 | If no password argument is given and a password is required, | ||
6678 | then the user is prompted to enter one: | ||
6679 | this will typically be read from the current terminal with echoing turned off. | ||
6680 | .Bl -tag -width "pass:password" -offset indent | ||
6681 | .It Cm pass : Ns Ar password | ||
6682 | The actual password is | ||
6683 | .Ar password . | ||
6684 | Since the password is visible to utilities, | ||
6685 | this form should only be used where security is not important. | ||
6686 | .It Cm env : Ns Ar var | ||
6687 | Obtain the password from the environment variable | ||
6688 | .Ar var . | ||
6689 | Since the environment of other processes is visible, | ||
6690 | this option should be used with caution. | ||
6691 | .It Cm file : Ns Ar path | ||
6692 | The first line of | ||
6693 | .Ar path | ||
6694 | is the password. | ||
6695 | If the same | ||
6696 | .Ar path | ||
6697 | argument is supplied to | ||
6698 | .Fl passin | ||
6699 | and | ||
6700 | .Fl passout , | ||
6701 | then the first line will be used for the input password and the next line | ||
6702 | for the output password. | ||
6703 | .Ar path | ||
6704 | need not refer to a regular file: | ||
6705 | it could, for example, refer to a device or named pipe. | ||
6706 | .It Cm fd : Ns Ar number | ||
6707 | Read the password from the file descriptor | ||
6708 | .Ar number . | ||
6709 | This can be used to send the data via a pipe, for example. | ||
6710 | .It Cm stdin | ||
6711 | Read the password from standard input. | ||
6712 | .El | ||
6713 | .Pp | ||
6714 | Input/output formats, | ||
6715 | typically specified using | ||
6716 | .Fl inform | ||
6717 | and | ||
6718 | .Fl outform , | ||
6719 | indicate the format being read from or written to. | ||
6720 | The argument is case insensitive. | ||
6721 | .Pp | ||
6722 | .Bl -tag -width Ds -offset indent -compact | ||
6723 | .It Cm der | ||
6724 | Distinguished Encoding Rules (DER) | ||
6725 | is a binary format. | ||
6726 | .It Cm net | ||
6727 | Insecure legacy format. | ||
6728 | .It Cm pem | ||
6729 | Privacy Enhanced Mail (PEM) | ||
6730 | is base64-encoded. | ||
6731 | .It Cm pvk | ||
6732 | Private Key format. | ||
6733 | .It Cm smime | ||
6734 | An SMIME format message. | ||
6735 | .It Cm txt | ||
6736 | Plain ASCII text. | ||
6737 | .El | ||
6738 | .Sh ENVIRONMENT | ||
6739 | The following environment variables affect the execution of | ||
6740 | .Nm openssl : | ||
6741 | .Bl -tag -width "/etc/ssl/openssl.cnf" | ||
6742 | .It Ev OPENSSL_CONF | ||
6743 | The location of the master configuration file. | ||
6744 | .El | ||
6745 | .Sh FILES | ||
6746 | .Bl -tag -width "/etc/ssl/openssl.cnf" -compact | ||
6747 | .It Pa /etc/ssl/ | ||
6748 | Default config directory for | ||
6749 | .Nm openssl . | ||
6750 | .It Pa /etc/ssl/lib/ | ||
6751 | Unused. | ||
6752 | .It Pa /etc/ssl/private/ | ||
6753 | Default private key directory. | ||
6754 | .It Pa /etc/ssl/openssl.cnf | ||
6755 | Default configuration file for | ||
6756 | .Nm openssl . | ||
6757 | .It Pa /etc/ssl/x509v3.cnf | ||
6758 | Default configuration file for | ||
6759 | .Nm x509 | ||
6760 | certificates. | ||
6761 | .El | ||
6762 | .Sh SEE ALSO | ||
6763 | .Xr acme-client 1 , | ||
6764 | .Xr nc 1 , | ||
6765 | .Xr openssl.cnf 5 , | ||
6766 | .Xr x509v3.cnf 5 , | ||
6767 | .Xr ssl 8 , | ||
6768 | .Xr starttls 8 | ||
6769 | .Sh STANDARDS | ||
6770 | .Rs | ||
6771 | .%A T. Dierks | ||
6772 | .%A C. Allen | ||
6773 | .%D January 1999 | ||
6774 | .%R RFC 2246 | ||
6775 | .%T The TLS Protocol Version 1.0 | ||
6776 | .Re | ||
6777 | .Pp | ||
6778 | .Rs | ||
6779 | .%A M. Wahl | ||
6780 | .%A S. Killie | ||
6781 | .%A T. Howes | ||
6782 | .%D December 1997 | ||
6783 | .%R RFC 2253 | ||
6784 | .%T Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names | ||
6785 | .Re | ||
6786 | .Pp | ||
6787 | .Rs | ||
6788 | .%A B. Kaliski | ||
6789 | .%D March 1998 | ||
6790 | .%R RFC 2315 | ||
6791 | .%T PKCS #7: Cryptographic Message Syntax Version 1.5 | ||
6792 | .Re | ||
6793 | .Pp | ||
6794 | .Rs | ||
6795 | .%A R. Housley | ||
6796 | .%A W. Ford | ||
6797 | .%A W. Polk | ||
6798 | .%A D. Solo | ||
6799 | .%D January 1999 | ||
6800 | .%R RFC 2459 | ||
6801 | .%T Internet X.509 Public Key Infrastructure Certificate and CRL Profile | ||
6802 | .Re | ||
6803 | .Pp | ||
6804 | .Rs | ||
6805 | .%A M. Myers | ||
6806 | .%A R. Ankney | ||
6807 | .%A A. Malpani | ||
6808 | .%A S. Galperin | ||
6809 | .%A C. Adams | ||
6810 | .%D June 1999 | ||
6811 | .%R RFC 2560 | ||
6812 | .%T X.509 Internet Public Key Infrastructure Online Certificate Status Protocol \(en OCSP | ||
6813 | .Re | ||
6814 | .Pp | ||
6815 | .Rs | ||
6816 | .%A R. Housley | ||
6817 | .%D June 1999 | ||
6818 | .%R RFC 2630 | ||
6819 | .%T Cryptographic Message Syntax | ||
6820 | .Re | ||
6821 | .Pp | ||
6822 | .Rs | ||
6823 | .%A P. Chown | ||
6824 | .%D June 2002 | ||
6825 | .%R RFC 3268 | ||
6826 | .%T Advanced Encryption Standard (AES) Ciphersuites for Transport Layer Security (TLS) | ||
6827 | .Re | ||