diff options
author | jmc <> | 2003-08-30 17:30:54 +0000 |
---|---|---|
committer | jmc <> | 2003-08-30 17:30:54 +0000 |
commit | 199384f95e02a8b4186670744adfe15a7d7bec31 (patch) | |
tree | 6a59943f64e80683a7f2de8c6c68514b6d845253 | |
parent | 0d375da66d1059b3e8796fc2c3fe859995d35e88 (diff) | |
download | openbsd-199384f95e02a8b4186670744adfe15a7d7bec31.tar.gz openbsd-199384f95e02a8b4186670744adfe15a7d7bec31.tar.bz2 openbsd-199384f95e02a8b4186670744adfe15a7d7bec31.zip |
- sync SYNOPSIS(es) and ciphers/digests available with reality
- remove non-OBSD details
- indent examples
- general macro/punctuation cleanup
-rw-r--r-- | src/usr.sbin/openssl/openssl.1 | 2992 |
1 files changed, 1684 insertions, 1308 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1 index ad7e25ffbf..1229888c16 100644 --- a/src/usr.sbin/openssl/openssl.1 +++ b/src/usr.sbin/openssl/openssl.1 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: openssl.1,v 1.11 2003/08/08 10:13:33 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.12 2003/08/30 17:30:54 jmc Exp $ |
2 | .\" ==================================================================== | 2 | .\" ==================================================================== |
3 | .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
4 | .\" | 4 | .\" |
@@ -128,7 +128,7 @@ | |||
128 | .Bk -words | 128 | .Bk -words |
129 | .Oo Cm list-standard-commands Li |\ \& | 129 | .Oo Cm list-standard-commands Li |\ \& |
130 | .Cm list-message-digest-commands | | 130 | .Cm list-message-digest-commands | |
131 | .Cm \ \ \ \ list-cipher-commands | 131 | .Cm \ \&\ \&\ \&\ \&\ \&list-cipher-commands |
132 | .Oc | 132 | .Oc |
133 | .Ek | 133 | .Ek |
134 | .Pp | 134 | .Pp |
@@ -138,8 +138,10 @@ | |||
138 | .Sh DESCRIPTION | 138 | .Sh DESCRIPTION |
139 | .Nm OpenSSL | 139 | .Nm OpenSSL |
140 | is a cryptography toolkit implementing the Secure Sockets Layer | 140 | is a cryptography toolkit implementing the Secure Sockets Layer |
141 | (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and | 141 | .Pq SSL v2/v3 |
142 | related cryptography standards required by them. | 142 | and Transport Layer Security |
143 | .Pq TLS v1 | ||
144 | network protocols and related cryptography standards required by them. | ||
143 | .Pp | 145 | .Pp |
144 | The | 146 | The |
145 | .Nm | 147 | .Nm |
@@ -150,7 +152,7 @@ cryptography functions of | |||
150 | library from the shell. | 152 | library from the shell. |
151 | It can be used for | 153 | It can be used for |
152 | .Pp | 154 | .Pp |
153 | .Bl -bullet -compact | 155 | .Bl -bullet -offset indent -compact |
154 | .It | 156 | .It |
155 | Creation of RSA, DH and DSA key parameters | 157 | Creation of RSA, DH and DSA key parameters |
156 | .It | 158 | .It |
@@ -185,9 +187,10 @@ The pseudo-commands | |||
185 | .Cm list-standard-commands , list-message-digest-commands , | 187 | .Cm list-standard-commands , list-message-digest-commands , |
186 | and | 188 | and |
187 | .Cm list-cipher-commands | 189 | .Cm list-cipher-commands |
188 | output a list (one entry per line) of the names | 190 | output a list |
189 | of all standard commands, message digest commands, or cipher commands, | 191 | .Pq one entry per line |
190 | respectively, that are available in the present | 192 | of the names of all standard commands, message digest commands, |
193 | or cipher commands, respectively, that are available in the present | ||
191 | .Nm | 194 | .Nm |
192 | utility. | 195 | utility. |
193 | .Pp | 196 | .Pp |
@@ -198,7 +201,9 @@ specified name is available. | |||
198 | If no command named | 201 | If no command named |
199 | .Ar XXX | 202 | .Ar XXX |
200 | exists, | 203 | exists, |
201 | it returns 0 (success) and prints | 204 | it returns 0 |
205 | .Pq success | ||
206 | and prints | ||
202 | .Cm no- Ns Ar XXX ; | 207 | .Cm no- Ns Ar XXX ; |
203 | otherwise it returns 1 and prints | 208 | otherwise it returns 1 and prints |
204 | .Ar XXX . | 209 | .Ar XXX . |
@@ -226,11 +231,15 @@ itself. | |||
226 | .It Cm asn1parse | 231 | .It Cm asn1parse |
227 | Parse an ASN.1 sequence. | 232 | Parse an ASN.1 sequence. |
228 | .It Cm ca | 233 | .It Cm ca |
229 | Certificate Authority (CA) Management. | 234 | Certificate Authority |
235 | .Pq CA | ||
236 | Management. | ||
230 | .It Cm ciphers | 237 | .It Cm ciphers |
231 | Cipher Suite Description Determination. | 238 | Cipher Suite Description Determination. |
232 | .It Cm crl | 239 | .It Cm crl |
233 | Certificate Revocation List (CRL) Management. | 240 | Certificate Revocation List |
241 | .Pq CRL | ||
242 | Management. | ||
234 | .It Cm crl2pkcs7 | 243 | .It Cm crl2pkcs7 |
235 | CRL to PKCS#7 Conversion. | 244 | CRL to PKCS#7 Conversion. |
236 | .It Cm dgst | 245 | .It Cm dgst |
@@ -258,7 +267,7 @@ Generation of DSA Parameters. | |||
258 | .It Cm genrsa | 267 | .It Cm genrsa |
259 | Generation of RSA Parameters. | 268 | Generation of RSA Parameters. |
260 | .It Cm nseq | 269 | .It Cm nseq |
261 | Create or examine a netscape certificate sequence. | 270 | Create or examine a Netscape certificate sequence. |
262 | .It Cm ocsp | 271 | .It Cm ocsp |
263 | Online Certificate Status Protocol utility. | 272 | Online Certificate Status Protocol utility. |
264 | .It Cm passwd | 273 | .It Cm passwd |
@@ -272,7 +281,9 @@ PKCS#12 Data Management. | |||
272 | .It Cm rand | 281 | .It Cm rand |
273 | Generate pseudo-random bytes. | 282 | Generate pseudo-random bytes. |
274 | .It Cm req | 283 | .It Cm req |
275 | X.509 Certificate Signing Request (CSR) Management. | 284 | X.509 Certificate Signing Request |
285 | .Pq CSR | ||
286 | Management. | ||
276 | .It Cm rsa | 287 | .It Cm rsa |
277 | RSA Data Management. | 288 | RSA Data Management. |
278 | .It Cm rsautl | 289 | .It Cm rsautl |
@@ -318,10 +329,10 @@ X.509 Certificate Data Management. | |||
318 | .Bl -tag -width "asn1parse" | 329 | .Bl -tag -width "asn1parse" |
319 | .It Cm md2 | 330 | .It Cm md2 |
320 | MD2 Digest. | 331 | MD2 Digest. |
332 | .It Cm md4 | ||
333 | MD4 Digest. | ||
321 | .It Cm md5 | 334 | .It Cm md5 |
322 | MD5 Digest. | 335 | MD5 Digest. |
323 | .It Cm mdc2 | ||
324 | MDC2 Digest. | ||
325 | .It Cm rmd160 | 336 | .It Cm rmd160 |
326 | RMD-160 Digest. | 337 | RMD-160 Digest. |
327 | .It Cm sha | 338 | .It Cm sha |
@@ -330,28 +341,47 @@ SHA Digest. | |||
330 | SHA-1 Digest. | 341 | SHA-1 Digest. |
331 | .El | 342 | .El |
332 | .Sh ENCODING AND CIPHER COMMANDS | 343 | .Sh ENCODING AND CIPHER COMMANDS |
333 | .Bl -tag -width "asn1parse" | 344 | .Bl -tag -width Ds -compact |
345 | .It Cm aes-128-cbc | aes-128-ecb | aes-192-cbc | aes-192-ecb | | ||
346 | .It Cm aes-256-cbc | aes-256-ecb | ||
347 | AES Cipher. | ||
348 | .Pp | ||
334 | .It Cm base64 | 349 | .It Cm base64 |
335 | Base64 Encoding. | 350 | Base64 Encoding. |
336 | .It Cm bf bf-cbc bf-cfb bf-ecb bf-ofb | 351 | .Pp |
352 | .It Xo | ||
353 | .Cm bf | bf-cbc | bf-cfb | | ||
354 | .Cm bf-ecb | bf-ofb | ||
355 | .Xc | ||
337 | Blowfish Cipher. | 356 | Blowfish Cipher. |
338 | .It Cm cast cast-cbc | 357 | .Pp |
358 | .It Cm cast | cast-cbc | ||
339 | CAST Cipher. | 359 | CAST Cipher. |
340 | .It Cm cast5-cbc cast5-cfb cast5-ecb cast5-ofb | 360 | .Pp |
361 | .It Cm cast5-cbc | cast5-cfb | cast5-ecb | cast5-ofb | ||
341 | CAST5 Cipher. | 362 | CAST5 Cipher. |
342 | .It Cm des des-cbc des-cfb des-ecb des-ede des-ede-cbc | 363 | .Pp |
343 | .It Cm des-ede-cfb des-ede-ofb des-ofb | 364 | .It Xo |
365 | .Cm des | des-cbc | des-cfb | des-ecb | | ||
366 | .Cm des-ede | des-ede-cbc | ||
367 | .Xc | ||
368 | .It Cm des-ede-cfb | des-ede-ofb | des-ofb | ||
344 | DES Cipher. | 369 | DES Cipher. |
345 | .It Cm des3 desx des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb | 370 | .Pp |
371 | .It Xo | ||
372 | .Cm des3 | desx | des-ede3 | | ||
373 | .Cm des-ede3-cbc | des-ede3-cfb | des-ede3-ofb | ||
374 | .Xc | ||
346 | Triple-DES Cipher. | 375 | Triple-DES Cipher. |
347 | .It Cm idea idea-cbc idea-cfb idea-ecb idea-ofb | 376 | .Pp |
348 | IDEA Cipher. | 377 | .It Xo |
349 | .It Cm rc2 rc2-cbc rc2-cfb rc2-ecb rc2-ofb | 378 | .Cm rc2 | rc2-40-cbc | rc2-64-cbc | rc2-cbc | |
379 | .Cm rc2-cfb | rc2-ecb | rc2-ofb | ||
380 | .Xc | ||
350 | RC2 Cipher. | 381 | RC2 Cipher. |
351 | .It Cm rc4 | 382 | .Pp |
383 | .It Cm rc4 | rc4-40 | ||
352 | RC4 Cipher. | 384 | RC4 Cipher. |
353 | .It Cm rc5 rc5-cbc rc5-cfb rc5-ecb rc5-ofb | ||
354 | RC5 Cipher. | ||
355 | .El | 385 | .El |
356 | .Sh PASS PHRASE ARGUMENTS | 386 | .Sh PASS PHRASE ARGUMENTS |
357 | Several commands accept password arguments, typically using | 387 | Several commands accept password arguments, typically using |
@@ -365,21 +395,25 @@ If no password argument is given and a password is required then the user is | |||
365 | prompted to enter one: this will typically be read from the current | 395 | prompted to enter one: this will typically be read from the current |
366 | terminal with echoing turned off. | 396 | terminal with echoing turned off. |
367 | .Bl -tag -width "fd:number" | 397 | .Bl -tag -width "fd:number" |
368 | .It Ar pass:password | 398 | .It Ar pass Ns : Ns Ar password |
369 | The actual password is | 399 | The actual password is |
370 | .Ar password . | 400 | .Ar password . |
371 | Since the password is visible to utilities | 401 | Since the password is visible to utilities |
372 | (like | 402 | (like |
373 | .Xr ps 1 | 403 | .Xr ps 1 |
374 | under Unix) this form should only be used where security is not important. | 404 | under |
375 | .It Ar env:var | 405 | .Ux ) |
406 | this form should only be used where security is not important. | ||
407 | .It Ar env Ns : Ns Ar var | ||
376 | Obtain the password from the environment variable | 408 | Obtain the password from the environment variable |
377 | .Ar var . | 409 | .Ar var . |
378 | Since the environment of other processes is visible on certain platforms | 410 | Since the environment of other processes is visible on certain platforms |
379 | (e.g. | 411 | (e.g.\& |
380 | .Xr ps 1 | 412 | .Xr ps 1 |
381 | under certain Unix OSes) this option should be used with caution. | 413 | under certain |
382 | .It Ar file:pathname | 414 | .Ux |
415 | OSes) this option should be used with caution. | ||
416 | .It Ar file Ns : Ns Ar pathname | ||
383 | The first line of | 417 | The first line of |
384 | .Ar pathname | 418 | .Ar pathname |
385 | is the password. | 419 | is the password. |
@@ -388,13 +422,13 @@ If the same | |||
388 | argument is supplied to | 422 | argument is supplied to |
389 | .Fl passin | 423 | .Fl passin |
390 | and | 424 | and |
391 | .Fl passout | 425 | .Fl passout , |
392 | then the first line will be used for the input password and the next line | 426 | then the first line will be used for the input password and the next line |
393 | for the output password. | 427 | for the output password. |
394 | .Ar pathname | 428 | .Ar pathname |
395 | need not refer to a regular file: | 429 | need not refer to a regular file: |
396 | it could, for example, refer to a device or named pipe. | 430 | it could, for example, refer to a device or named pipe. |
397 | .It Ar fd:number | 431 | .It Ar fd Ns : Ns Ar number |
398 | Read the password from the file descriptor | 432 | Read the password from the file descriptor |
399 | .Ar number . | 433 | .Ar number . |
400 | This can be used to send the data via a pipe for example. | 434 | This can be used to send the data via a pipe for example. |
@@ -406,15 +440,19 @@ Read the password from standard input. | |||
406 | .\" | 440 | .\" |
407 | .Sh ASN1PARSE | 441 | .Sh ASN1PARSE |
408 | .Nm "openssl asn1parse" | 442 | .Nm "openssl asn1parse" |
409 | .Op Fl inform Ar PEM|DER | 443 | .Bk -words |
444 | .Op Fl inform Ar DER | PEM | TXT | ||
410 | .Op Fl in Ar filename | 445 | .Op Fl in Ar filename |
411 | .Op Fl out Ar filename | 446 | .Op Fl out Ar filename |
412 | .Op Fl noout | 447 | .Op Fl noout |
413 | .Op Fl offset Ar number | 448 | .Op Fl offset Ar number |
414 | .Op Fl length Ar number | 449 | .Op Fl length Ar number |
415 | .Op Fl i | 450 | .Op Fl i |
451 | .Op Fl dump | ||
452 | .Op Fl dlimit Ar number | ||
416 | .Op Fl oid Ar filename | 453 | .Op Fl oid Ar filename |
417 | .Op Fl strparse Ar offset | 454 | .Op Fl strparse Ar offset |
455 | .Ek | ||
418 | .Pp | 456 | .Pp |
419 | The | 457 | The |
420 | .Nm asn1parse | 458 | .Nm asn1parse |
@@ -423,12 +461,15 @@ It can also be used to extract data from ASN.1 formatted data. | |||
423 | .Pp | 461 | .Pp |
424 | The options are as follows: | 462 | The options are as follows: |
425 | .Bl -tag -width "XXXX" | 463 | .Bl -tag -width "XXXX" |
426 | .It Fl inform Ar DER|PEM | 464 | .It Fl inform Ar DER | PEM | TXT |
427 | The input format. | 465 | The input format. |
428 | .Ar DER | 466 | .Ar DER |
429 | is binary format and | 467 | is binary format and |
430 | .Ar PEM | 468 | .Ar PEM |
431 | (the default) is base64 encoded. | 469 | .Pq the default |
470 | is base64 encoded. | ||
471 | .Ar TXT | ||
472 | is plain text. | ||
432 | .It Fl in Ar filename | 473 | .It Fl in Ar filename |
433 | The input file; default is standard input. | 474 | The input file; default is standard input. |
434 | .It Fl out Ar filename | 475 | .It Fl out Ar filename |
@@ -446,16 +487,27 @@ Starting offset to begin parsing; default is start of file. | |||
446 | .It Fl length Ar number | 487 | .It Fl length Ar number |
447 | Number of bytes to parse; default is until end of file. | 488 | Number of bytes to parse; default is until end of file. |
448 | .It Fl i | 489 | .It Fl i |
449 | Indents the output according to the "depth" of the structures. | 490 | Indents the output according to the |
491 | .Qq depth | ||
492 | of the structures. | ||
493 | .It Fl dump | ||
494 | Dump unknown data in hex form. | ||
495 | .It Fl dlimit Ar number | ||
496 | Dump the first | ||
497 | .Ar number | ||
498 | bytes of unknown data in hex form. | ||
450 | .It Fl oid Ar filename | 499 | .It Fl oid Ar filename |
451 | A file containing additional OBJECT IDENTIFIERs (OIDs). | 500 | A file containing additional OBJECT IDENTIFIERs |
501 | .Pq OIDs . | ||
452 | The format of this file is described in the | 502 | The format of this file is described in the |
453 | .Sx ASN1PARSE NOTES | 503 | .Sx ASN1PARSE NOTES |
454 | section below. | 504 | section below. |
455 | .It Fl strparse Ar offset | 505 | .It Fl strparse Ar offset |
456 | Parse the contents octets of the ASN.1 object starting at | 506 | Parse the contents octets of the ASN.1 object starting at |
457 | .Ar offset . | 507 | .Ar offset . |
458 | This option can be used multiple times to "drill down" into a nested structure. | 508 | This option can be used multiple times to |
509 | .Qq drill down | ||
510 | into a nested structure. | ||
459 | .El | 511 | .El |
460 | .Sh ASN1PARSE OUTPUT | 512 | .Sh ASN1PARSE OUTPUT |
461 | The output will typically contain lines like this: | 513 | The output will typically contain lines like this: |
@@ -468,10 +520,10 @@ The output will typically contain lines like this: | |||
468 | 373:d=2 hl=3 l= 162 cons: cont [ 3 ] | 520 | 373:d=2 hl=3 l= 162 cons: cont [ 3 ] |
469 | 376:d=3 hl=3 l= 159 cons: SEQUENCE | 521 | 376:d=3 hl=3 l= 159 cons: SEQUENCE |
470 | 379:d=4 hl=2 l= 29 cons: SEQUENCE | 522 | 379:d=4 hl=2 l= 29 cons: SEQUENCE |
471 | 381:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Subject Key Identifier | 523 | 381:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Subject Key Identifier |
472 | 386:d=5 hl=2 l= 22 prim: OCTET STRING | 524 | 386:d=5 hl=2 l= 22 prim: OCTET STRING |
473 | 410:d=4 hl=2 l= 112 cons: SEQUENCE | 525 | 410:d=4 hl=2 l= 112 cons: SEQUENCE |
474 | 412:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier | 526 | 412:d=5 hl=2 l= 3 prim: OBJECT :X509v3 Authority Key Identifier |
475 | 417:d=5 hl=2 l= 105 prim: OCTET STRING | 527 | 417:d=5 hl=2 l= 105 prim: OCTET STRING |
476 | 524:d=4 hl=2 l= 12 cons: SEQUENCE | 528 | 524:d=4 hl=2 l= 12 cons: SEQUENCE |
477 | 529 | ||
@@ -484,7 +536,9 @@ Each line starts with the offset in decimal. | |||
484 | specifies the current depth. | 536 | specifies the current depth. |
485 | The depth is increased within the scope of any SET or SEQUENCE. | 537 | The depth is increased within the scope of any SET or SEQUENCE. |
486 | .Cm hl=XX | 538 | .Cm hl=XX |
487 | gives the header length (tag and length octets) of the current type. | 539 | gives the header length |
540 | .Pq tag and length octets | ||
541 | of the current type. | ||
488 | .Cm l=XX | 542 | .Cm l=XX |
489 | gives the length of the contents octets. | 543 | gives the length of the contents octets. |
490 | .Pp | 544 | .Pp |
@@ -508,24 +562,28 @@ to yield: | |||
508 | If an OID is not part of | 562 | If an OID is not part of |
509 | .Nm OpenSSL Ns Li 's | 563 | .Nm OpenSSL Ns Li 's |
510 | internal table it will be represented in | 564 | internal table it will be represented in |
511 | numerical form (for example 1.2.3.4). | 565 | numerical form |
566 | .Pq for example 1.2.3.4 . | ||
512 | The file passed to the | 567 | The file passed to the |
513 | .Fl oid | 568 | .Fl oid |
514 | option allows additional OIDs to be included. | 569 | option allows additional OIDs to be included. |
515 | Each line consists of three columns, | 570 | Each line consists of three columns; |
516 | the first column is the OID in numerical format and should be followed by | 571 | the first column is the OID in numerical format and should be followed by |
517 | whitespace. | 572 | whitespace. |
518 | The second column is the "short name" which is a single word followed | 573 | The second column is the |
519 | by whitespace. | 574 | .Qq short name |
520 | The final column is the rest of the line and is the "long name". | 575 | which is a single word followed by whitespace. |
576 | The final column is the rest of the line and is the | ||
577 | .Qq long name . | ||
521 | .Nm asn1parse | 578 | .Nm asn1parse |
522 | displays the long name. | 579 | displays the long name. |
523 | Example: | 580 | Example: |
524 | .Pp | 581 | .Pp |
525 | "1.2.3.4 shortName A long name" | 582 | .Dl \&"1.2.3.4 shortName A long name\&" |
526 | .Sh ASN1PARSE BUGS | 583 | .Sh ASN1PARSE BUGS |
527 | There should be options to change the format of input lines. | 584 | There should be options to change the format of input lines. |
528 | The output of some ASN.1 types is not well handled (if at all). | 585 | The output of some ASN.1 types is not well handled |
586 | .Pq if at all . | ||
529 | .\" | 587 | .\" |
530 | .\" ca | 588 | .\" ca |
531 | .\" | 589 | .\" |
@@ -551,6 +609,7 @@ The output of some ASN.1 types is not well handled (if at all). | |||
551 | .Op Fl md Ar arg | 609 | .Op Fl md Ar arg |
552 | .Op Fl policy Ar arg | 610 | .Op Fl policy Ar arg |
553 | .Op Fl keyfile Ar arg | 611 | .Op Fl keyfile Ar arg |
612 | .Op Fl keyform Ar PEM | ENGINE | ||
554 | .Op Fl key Ar arg | 613 | .Op Fl key Ar arg |
555 | .Op Fl passin Ar arg | 614 | .Op Fl passin Ar arg |
556 | .Op Fl cert Ar file | 615 | .Op Fl cert Ar file |
@@ -567,6 +626,8 @@ The output of some ASN.1 types is not well handled (if at all). | |||
567 | .Op Fl msie_hack | 626 | .Op Fl msie_hack |
568 | .Op Fl extensions Ar section | 627 | .Op Fl extensions Ar section |
569 | .Op Fl extfile Ar section | 628 | .Op Fl extfile Ar section |
629 | .Op Fl status Ar serial | ||
630 | .Op Fl updatedb | ||
570 | .Op Fl engine Ar id | 631 | .Op Fl engine Ar id |
571 | .Ek | 632 | .Ek |
572 | .Pp | 633 | .Pp |
@@ -614,21 +675,27 @@ The | |||
614 | .Ar directory | 675 | .Ar directory |
615 | to output certificates to. | 676 | to output certificates to. |
616 | The certificate will be written to a filename consisting of the | 677 | The certificate will be written to a filename consisting of the |
617 | serial number in hex with ".pem" appended. | 678 | serial number in hex with |
679 | .Qq .pem | ||
680 | appended. | ||
618 | .It Fl cert | 681 | .It Fl cert |
619 | The CA certificate file. | 682 | The CA certificate file. |
620 | .It Fl keyfile Ar filename | 683 | .It Fl keyfile Ar filename |
621 | The private key to sign requests with. | 684 | The private key to sign requests with. |
685 | .It Fl keyform Ar PEM | ENGINE | ||
686 | Private key file format. | ||
622 | .It Fl key Ar password | 687 | .It Fl key Ar password |
623 | The password used to encrypt the private key. | 688 | The password used to encrypt the private key. |
624 | Since on some systems the command line arguments are visible | 689 | Since on some systems the command line arguments are visible |
625 | (e.g. Unix with the | 690 | (e.g.\& |
691 | .Ux | ||
692 | with the | ||
626 | .Xr ps 1 | 693 | .Xr ps 1 |
627 | utility) this option should be used with caution. | 694 | utility) this option should be used with caution. |
628 | .It Fl passin Ar arg | 695 | .It Fl passin Ar arg |
629 | The key password source. | 696 | The key password source. |
630 | For more information about the format of | 697 | For more information about the format of |
631 | .Ar arg | 698 | .Ar arg , |
632 | see the | 699 | see the |
633 | .Sx PASS PHRASE ARGUMENTS | 700 | .Sx PASS PHRASE ARGUMENTS |
634 | section above. | 701 | section above. |
@@ -639,22 +706,24 @@ Don't output the text form of a certificate to the output file. | |||
639 | .It Fl startdate Ar date | 706 | .It Fl startdate Ar date |
640 | This allows the start date to be explicitly set. | 707 | This allows the start date to be explicitly set. |
641 | The format of the date is YYMMDDHHMMSSZ | 708 | The format of the date is YYMMDDHHMMSSZ |
642 | (the same as an ASN1 UTCTime structure). | 709 | .Pq the same as an ASN1 UTCTime structure . |
643 | .It Fl enddate Ar date | 710 | .It Fl enddate Ar date |
644 | This allows the expiry date to be explicitly set. | 711 | This allows the expiry date to be explicitly set. |
645 | The format of the date is YYMMDDHHMMSSZ | 712 | The format of the date is YYMMDDHHMMSSZ |
646 | (the same as an ASN1 UTCTime structure). | 713 | .Pq the same as an ASN1 UTCTime structure . |
647 | .It Fl days Ar arg | 714 | .It Fl days Ar arg |
648 | The number of days to certify the certificate for. | 715 | The number of days to certify the certificate for. |
649 | .It Fl md Ar alg | 716 | .It Fl md Ar alg |
650 | The message digest to use. | 717 | The message digest to use. |
651 | Possible values include | 718 | Possible values include |
652 | .Ar md5 , sha1 | 719 | .Ar md5 |
653 | and | 720 | and |
654 | .Ar mdc2 . | 721 | .Ar sha1 . |
655 | This option also applies to CRLs. | 722 | This option also applies to CRLs. |
656 | .It Fl policy Ar arg | 723 | .It Fl policy Ar arg |
657 | This option defines the CA "policy" to use. | 724 | This option defines the CA |
725 | .Qq policy | ||
726 | to use. | ||
658 | This is a section in the configuration file which decides which fields | 727 | This is a section in the configuration file which decides which fields |
659 | should be mandatory or match the CA certificate. | 728 | should be mandatory or match the CA certificate. |
660 | Check out the | 729 | Check out the |
@@ -664,13 +733,15 @@ section for more information. | |||
664 | This is a legacy option to make | 733 | This is a legacy option to make |
665 | .Nm ca | 734 | .Nm ca |
666 | work with very old versions of the IE certificate enrollment control | 735 | work with very old versions of the IE certificate enrollment control |
667 | "certenr3". | 736 | .Qq certenr3 . |
668 | It used UniversalStrings for almost everything. | 737 | It used UniversalStrings for almost everything. |
669 | Since the old control has various security bugs, | 738 | Since the old control has various security bugs, |
670 | its use is strongly discouraged. | 739 | its use is strongly discouraged. |
671 | The newer control "Xenroll" does not need this option. | 740 | The newer control |
741 | .Qq Xenroll | ||
742 | does not need this option. | ||
672 | .It Fl preserveDN | 743 | .It Fl preserveDN |
673 | Normally the DN order of a certificate is the same as the order of the | 744 | Normally, the DN order of a certificate is the same as the order of the |
674 | fields in the relevant policy section. | 745 | fields in the relevant policy section. |
675 | When this option is set, the order is the same as the request. | 746 | When this option is set, the order is the same as the request. |
676 | This is largely for compatibility with the older IE enrollment control | 747 | This is largely for compatibility with the older IE enrollment control |
@@ -683,7 +754,7 @@ request DN, however it is good policy just having the e-mail set into | |||
683 | the | 754 | the |
684 | .Em altName | 755 | .Em altName |
685 | extension of the certificate. | 756 | extension of the certificate. |
686 | When this option is set the EMAIL field is removed from the certificate's | 757 | When this option is set, the EMAIL field is removed from the certificate's |
687 | subject and set only in the, eventually present, extensions. | 758 | subject and set only in the, eventually present, extensions. |
688 | The | 759 | The |
689 | .Ar email_in_dn | 760 | .Ar email_in_dn |
@@ -700,7 +771,8 @@ unless the | |||
700 | .Fl extfile | 771 | .Fl extfile |
701 | option is used). | 772 | option is used). |
702 | If no extension section is present, then a V1 certificate is created. | 773 | If no extension section is present, then a V1 certificate is created. |
703 | If the extension section is present (even if it is empty), | 774 | If the extension section is present |
775 | .Pq even if it is empty , | ||
704 | then a V3 certificate is created. | 776 | then a V3 certificate is created. |
705 | .It Fl extfile Ar file | 777 | .It Fl extfile Ar file |
706 | An additional configuration | 778 | An additional configuration |
@@ -709,11 +781,16 @@ to read certificate extensions from | |||
709 | (using the default section unless the | 781 | (using the default section unless the |
710 | .Fl extensions | 782 | .Fl extensions |
711 | option is also used). | 783 | option is also used). |
784 | .It Fl status Ar serial | ||
785 | Show status of certificate with serial number | ||
786 | .Ar serial . | ||
787 | .It Fl updatedb | ||
788 | Update database for expired certificates. | ||
712 | .It Fl engine Ar id | 789 | .It Fl engine Ar id |
713 | Specifying an engine (by it's unique | 790 | Specifying an engine (by it's unique |
714 | .Ar id | 791 | .Ar id |
715 | string) will cause | 792 | string) will cause |
716 | .Nm req | 793 | .Nm ca |
717 | to attempt to obtain a functional reference to the specified engine, | 794 | to attempt to obtain a functional reference to the specified engine, |
718 | thus initialising it if needed. | 795 | thus initialising it if needed. |
719 | The engine will then be set as the default for all available algorithms. | 796 | The engine will then be set as the default for all available algorithms. |
@@ -743,7 +820,7 @@ The matching of | |||
743 | .Ar reason | 820 | .Ar reason |
744 | is case insensitive. | 821 | is case insensitive. |
745 | Setting any revocation reason will make the CRL v2. | 822 | Setting any revocation reason will make the CRL v2. |
746 | In practive removeFromCRL is not particularly useful because it is only used | 823 | In practice, removeFromCRL is not particularly useful because it is only used |
747 | in delta CRLs which are not currently implemented. | 824 | in delta CRLs which are not currently implemented. |
748 | .It Fl crl_hold Ar instruction | 825 | .It Fl crl_hold Ar instruction |
749 | This sets the CRL revocation reason code to certificateHold and the hold | 826 | This sets the CRL revocation reason code to certificateHold and the hold |
@@ -768,18 +845,23 @@ The | |||
768 | .Ar arg | 845 | .Ar arg |
769 | must be formatted as | 846 | must be formatted as |
770 | .Ar /type0=value0/type1=value1/type2=... ; | 847 | .Ar /type0=value0/type1=value1/type2=... ; |
771 | characters may be escaped by \e (backslash), no spaces are skipped. | 848 | characters may be escaped by |
849 | .Sq \e | ||
850 | .Pq backslash , | ||
851 | no spaces are skipped. | ||
772 | .It Fl crlexts Ar section | 852 | .It Fl crlexts Ar section |
773 | The | 853 | The |
774 | .Ar section | 854 | .Ar section |
775 | of the configuration file containing CRL extensions to include. | 855 | of the configuration file containing CRL extensions to include. |
776 | If no CRL extension section is present then a V1 CRL is created; | 856 | If no CRL extension section is present then a V1 CRL is created; |
777 | if the CRL extension section is present (even if it is empty) | 857 | if the CRL extension section is present |
858 | .Pq even if it is empty | ||
778 | then a V2 CRL is created. | 859 | then a V2 CRL is created. |
779 | The CRL extensions specified are CRL extensions and | 860 | The CRL extensions specified are CRL extensions and |
780 | .Em not | 861 | .Em not |
781 | CRL entry extensions. | 862 | CRL entry extensions. |
782 | It should be noted that some software (for example Netscape) | 863 | It should be noted that some software |
864 | .Pq for example Netscape | ||
783 | can't handle V2 CRLs. | 865 | can't handle V2 CRLs. |
784 | .El | 866 | .El |
785 | .Sh CA CONFIGURATION FILE OPTIONS | 867 | .Sh CA CONFIGURATION FILE OPTIONS |
@@ -801,9 +883,11 @@ the following options are read directly from the | |||
801 | .Em ca | 883 | .Em ca |
802 | section: | 884 | section: |
803 | .Pp | 885 | .Pp |
804 | RANDFILE | 886 | .Bl -tag -width Ds -offset indent -compact |
805 | preserve | 887 | .It RANDFILE |
806 | msie_hack | 888 | .It preserve |
889 | .It msie_hack | ||
890 | .El | ||
807 | .Pp | 891 | .Pp |
808 | With the exception of RANDFILE, this is probably a bug and may | 892 | With the exception of RANDFILE, this is probably a bug and may |
809 | change in future releases. | 893 | change in future releases. |
@@ -813,7 +897,9 @@ options. | |||
813 | Where the option is present in the configuration file and the command line, | 897 | Where the option is present in the configuration file and the command line, |
814 | the command line value is used. | 898 | the command line value is used. |
815 | Where an option is described as mandatory, then it must be present in | 899 | Where an option is described as mandatory, then it must be present in |
816 | the configuration file or the command line equivalent (if any) used. | 900 | the configuration file or the command line equivalent |
901 | .Pq if any | ||
902 | used. | ||
817 | .Bl -tag -width "XXXX" | 903 | .Bl -tag -width "XXXX" |
818 | .It Ar oid_file | 904 | .It Ar oid_file |
819 | This specifies a file containing additional OBJECT IDENTIFIERS. | 905 | This specifies a file containing additional OBJECT IDENTIFIERS. |
@@ -825,7 +911,7 @@ This specifies a section in the configuration file containing extra | |||
825 | object identifiers. | 911 | object identifiers. |
826 | Each line should consist of the short name of the object identifier | 912 | Each line should consist of the short name of the object identifier |
827 | followed by | 913 | followed by |
828 | .Cm = | 914 | .Sq = |
829 | and the numerical form. | 915 | and the numerical form. |
830 | The short and long names are the same when this option is used. | 916 | The short and long names are the same when this option is used. |
831 | .It Ar new_certs_dir | 917 | .It Ar new_certs_dir |
@@ -866,7 +952,8 @@ The same as the | |||
866 | option. | 952 | option. |
867 | Either this option or | 953 | Either this option or |
868 | .Ar default_days | 954 | .Ar default_days |
869 | (or the command line equivalents) must be present. | 955 | .Pq or the command line equivalents |
956 | must be present. | ||
870 | .It Ar default_crl_hours default_crl_days | 957 | .It Ar default_crl_hours default_crl_days |
871 | The same as the | 958 | The same as the |
872 | .Fl crlhours | 959 | .Fl crlhours |
@@ -902,8 +989,9 @@ The same as | |||
902 | The same as | 989 | The same as |
903 | .Fl noemailDN . | 990 | .Fl noemailDN . |
904 | If the EMAIL field is to be removed from the DN of the certificate, | 991 | If the EMAIL field is to be removed from the DN of the certificate, |
905 | simply set this to 'no'. | 992 | simply set this to |
906 | If not present the default is to allow for the EMAIL field in the | 993 | .Qq no . |
994 | If not present, the default is to allow for the EMAIL field in the | ||
907 | certificate's DN. | 995 | certificate's DN. |
908 | .It Ar msie_hack | 996 | .It Ar msie_hack |
909 | The same as | 997 | The same as |
@@ -932,11 +1020,11 @@ are permanently set and cannot be disabled | |||
932 | (this is because the certificate signature cannot be displayed because | 1020 | (this is because the certificate signature cannot be displayed because |
933 | the certificate has not been signed at this point). | 1021 | the certificate has not been signed at this point). |
934 | .Pp | 1022 | .Pp |
935 | For convenience the values | 1023 | For convenience, the value |
936 | .Em default_ca | 1024 | .Em default_ca |
937 | are accepted by both to produce a reasonable output. | 1025 | is accepted by both to produce a reasonable output. |
938 | .Pp | 1026 | .Pp |
939 | If neither option is present the format used in earlier versions of | 1027 | If neither option is present, the format used in earlier versions of |
940 | .Nm OpenSSL | 1028 | .Nm OpenSSL |
941 | is used. | 1029 | is used. |
942 | Use of the old format is | 1030 | Use of the old format is |
@@ -952,11 +1040,11 @@ If set to | |||
952 | or this option is not present, then extensions are | 1040 | or this option is not present, then extensions are |
953 | ignored and not copied to the certificate. | 1041 | ignored and not copied to the certificate. |
954 | If set to | 1042 | If set to |
955 | .Ar copy | 1043 | .Ar copy , |
956 | then any extensions present in the request that are not already present | 1044 | then any extensions present in the request that are not already present |
957 | are copied to the certificate. | 1045 | are copied to the certificate. |
958 | If set to | 1046 | If set to |
959 | .Ar copyall | 1047 | .Ar copyall , |
960 | then all extensions in the request are copied to the certificate: | 1048 | then all extensions in the request are copied to the certificate: |
961 | if the extension is already present in the certificate it is deleted first. | 1049 | if the extension is already present in the certificate it is deleted first. |
962 | See the | 1050 | See the |
@@ -970,10 +1058,15 @@ values for certain extensions such as | |||
970 | .Sh CA POLICY FORMAT | 1058 | .Sh CA POLICY FORMAT |
971 | The policy section consists of a set of variables corresponding to | 1059 | The policy section consists of a set of variables corresponding to |
972 | certificate DN fields. | 1060 | certificate DN fields. |
973 | If the value is "match" then the field value | 1061 | If the value is |
974 | must match the same field in the CA certificate. | 1062 | .Qq match , |
975 | If the value is "supplied" then it must be present. | 1063 | then the field value must match the same field in the CA certificate. |
976 | If the value is "optional" then it may be present. | 1064 | If the value is |
1065 | .Qq supplied , | ||
1066 | then it must be present. | ||
1067 | If the value is | ||
1068 | .Qq optional , | ||
1069 | then it may be present. | ||
977 | Any fields not mentioned in the policy section | 1070 | Any fields not mentioned in the policy section |
978 | are silently deleted, unless the | 1071 | are silently deleted, unless the |
979 | .Fl preserveDN | 1072 | .Fl preserveDN |
@@ -992,8 +1085,9 @@ utility. | |||
992 | .Pp | 1085 | .Pp |
993 | The file should contain the variable SPKAC set to the value of | 1086 | The file should contain the variable SPKAC set to the value of |
994 | the SPKAC and also the required DN components as name value pairs. | 1087 | the SPKAC and also the required DN components as name value pairs. |
995 | If it's necessary to include the same component twice then it can be | 1088 | If it's necessary to include the same component twice, |
996 | preceded by a number and a '.'. | 1089 | then it can be preceded by a number and a |
1090 | .Sq \&. . | ||
997 | .Sh CA EXAMPLES | 1091 | .Sh CA EXAMPLES |
998 | .Sy Note : | 1092 | .Sy Note : |
999 | these examples assume that the | 1093 | these examples assume that the |
@@ -1016,36 +1110,39 @@ and its private key to | |||
1016 | .Pa demoCA/private/cakey.pem . | 1110 | .Pa demoCA/private/cakey.pem . |
1017 | A file | 1111 | A file |
1018 | .Pa demoCA/serial | 1112 | .Pa demoCA/serial |
1019 | would be created containing, for example, "01" and the empty index file | 1113 | would be created containing, for example, |
1114 | .Qq 01 | ||
1115 | and the empty index file | ||
1020 | .Pa demoCA/index.txt . | 1116 | .Pa demoCA/index.txt . |
1021 | .Pp | 1117 | .Pp |
1022 | Sign a certificate request: | 1118 | Sign a certificate request: |
1023 | .Pp | 1119 | .Pp |
1024 | \& $ openssl ca -in req.pem -out newcert.pem | 1120 | .Dl $ openssl ca -in req.pem -out newcert.pem |
1025 | .Pp | 1121 | .Pp |
1026 | Sign a certificate request, using CA extensions: | 1122 | Sign a certificate request, using CA extensions: |
1027 | .Pp | 1123 | .Pp |
1028 | \& $ openssl ca -in req.pem -extensions v3_ca -out newcert.pem | 1124 | .Dl $ openssl ca -in req.pem -extensions v3_ca -out newcert.pem |
1029 | .Pp | 1125 | .Pp |
1030 | Generate a CRL: | 1126 | Generate a CRL: |
1031 | .Pp | 1127 | .Pp |
1032 | \& $ openssl ca -gencrl -out crl.pem | 1128 | .Dl $ openssl ca -gencrl -out crl.pem |
1033 | .Pp | 1129 | .Pp |
1034 | Sign several requests: | 1130 | Sign several requests: |
1035 | .Pp | 1131 | .Pp |
1036 | \& $ openssl ca -infiles req1.pem req2.pem req3.pem | 1132 | .Dl $ openssl ca -infiles req1.pem req2.pem req3.pem |
1037 | .Pp | 1133 | .Pp |
1038 | Certify a Netscape SPKAC: | 1134 | Certify a Netscape SPKAC: |
1039 | .Pp | 1135 | .Pp |
1040 | \& $ openssl ca -spkac spkac.txt | 1136 | .Dl $ openssl ca -spkac spkac.txt |
1041 | .Pp | 1137 | .Pp |
1042 | A sample SPKAC file (the SPKAC line has been truncated for clarity): | 1138 | A sample SPKAC file |
1043 | .Bd -literal | 1139 | .Pq the SPKAC line has been truncated for clarity : |
1044 | \& SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5 | 1140 | .Bd -literal -offset indent |
1045 | \& CN=Steve Test | 1141 | SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK |
1046 | \& emailAddress=steve@openssl.org | 1142 | CN=Steve Test |
1047 | \& 0.OU=OpenSSL Group | 1143 | emailAddress=steve@openssl.org |
1048 | \& 1.OU=Another Group | 1144 | 0.OU=OpenSSL Group |
1145 | 1.OU=Another Group | ||
1049 | .Ed | 1146 | .Ed |
1050 | .Pp | 1147 | .Pp |
1051 | A sample configuration file with the relevant sections for | 1148 | A sample configuration file with the relevant sections for |
@@ -1053,29 +1150,29 @@ A sample configuration file with the relevant sections for | |||
1053 | .Bd -literal | 1150 | .Bd -literal |
1054 | \& [ ca ] | 1151 | \& [ ca ] |
1055 | \& default_ca = CA_default # The default ca section | 1152 | \& default_ca = CA_default # The default ca section |
1056 | .Pp | 1153 | |
1057 | \& [ CA_default ] | 1154 | \& [ CA_default ] |
1058 | .Pp | 1155 | |
1059 | \& dir = ./demoCA # top dir | 1156 | \& dir = ./demoCA # top dir |
1060 | \& database = $dir/index.txt # index file | 1157 | \& database = $dir/index.txt # index file |
1061 | \& new_certs_dir = $dir/newcerts # new certs dir | 1158 | \& new_certs_dir = $dir/newcerts # new certs dir |
1062 | .Pp | 1159 | |
1063 | \& certificate = $dir/cacert.pem # The CA cert | 1160 | \& certificate = $dir/cacert.pem # The CA cert |
1064 | \& serial = $dir/serial # serial no file | 1161 | \& serial = $dir/serial # serial no file |
1065 | \& private_key = $dir/private/cakey.pem# CA private key | 1162 | \& private_key = $dir/private/cakey.pem# CA private key |
1066 | \& RANDFILE = $dir/private/.rand # random number file | 1163 | \& RANDFILE = $dir/private/.rand # random number file |
1067 | .Pp | 1164 | |
1068 | \& default_days = 365 # how long to certify for | 1165 | \& default_days = 365 # how long to certify for |
1069 | \& default_crl_days= 30 # how long before next CRL | 1166 | \& default_crl_days= 30 # how long before next CRL |
1070 | \& default_md = md5 # md to use | 1167 | \& default_md = md5 # md to use |
1071 | .Pp | 1168 | |
1072 | \& policy = policy_any # default policy | 1169 | \& policy = policy_any # default policy |
1073 | \& email_in_dn = no # Don't add the email into cert DN | 1170 | \& email_in_dn = no # Don't add the email into cert DN |
1074 | .Pp | 1171 | |
1075 | \& nameopt = default_ca # Subject name display option | 1172 | \& nameopt = default_ca # Subject name display option |
1076 | \& certopt = default_ca # Certificate display option | 1173 | \& certopt = default_ca # Certificate display option |
1077 | \& copy_extensions = none # Don't copy extensions from request | 1174 | \& copy_extensions = none #Don't copy extensions from request |
1078 | .Pp | 1175 | |
1079 | \& [ policy_any ] | 1176 | \& [ policy_any ] |
1080 | \& countryName = supplied | 1177 | \& countryName = supplied |
1081 | \& stateOrProvinceName = optional | 1178 | \& stateOrProvinceName = optional |
@@ -1087,9 +1184,9 @@ A sample configuration file with the relevant sections for | |||
1087 | .Sh CA FILES | 1184 | .Sh CA FILES |
1088 | .Sy Note : | 1185 | .Sy Note : |
1089 | the location of all files can change either by compile time options, | 1186 | the location of all files can change either by compile time options, |
1090 | configuration file entries, environment variables or command line options. | 1187 | configuration file entries, environment variables, or command line options. |
1091 | The values below reflect the default values. | 1188 | The values below reflect the default values. |
1092 | .Bd -literal | 1189 | .Bd -literal -offset indent |
1093 | /usr/local/ssl/lib/openssl.cnf - master configuration file | 1190 | /usr/local/ssl/lib/openssl.cnf - master configuration file |
1094 | \&./demoCA - main CA directory | 1191 | \&./demoCA - main CA directory |
1095 | \&./demoCA/cacert.pem - CA certificate | 1192 | \&./demoCA/cacert.pem - CA certificate |
@@ -1102,7 +1199,7 @@ The values below reflect the default values. | |||
1102 | \&./demoCA/.rnd - CA random seed information | 1199 | \&./demoCA/.rnd - CA random seed information |
1103 | .Ed | 1200 | .Ed |
1104 | .Sh CA ENVIRONMENT VARIABLES | 1201 | .Sh CA ENVIRONMENT VARIABLES |
1105 | .Em OPENSSL_CONF | 1202 | .Ev OPENSSL_CONF |
1106 | reflects the location of the master configuration file; | 1203 | reflects the location of the master configuration file; |
1107 | it can be overridden by the | 1204 | it can be overridden by the |
1108 | .Fl config | 1205 | .Fl config |
@@ -1133,7 +1230,8 @@ The | |||
1133 | .Nm ca | 1230 | .Nm ca |
1134 | command really needs rewriting or the required functionality | 1231 | command really needs rewriting or the required functionality |
1135 | exposed at either a command or interface level so a more friendly utility | 1232 | exposed at either a command or interface level so a more friendly utility |
1136 | (perl script or GUI) can handle things properly. | 1233 | .Pq perl script or GUI |
1234 | can handle things properly. | ||
1137 | The scripts | 1235 | The scripts |
1138 | .Nm CA.sh | 1236 | .Nm CA.sh |
1139 | and | 1237 | and |
@@ -1174,7 +1272,7 @@ command on the same database can have unpredictable results. | |||
1174 | The | 1272 | The |
1175 | .Ar copy_extensions | 1273 | .Ar copy_extensions |
1176 | option should be used with caution. | 1274 | option should be used with caution. |
1177 | If care is not taken then it can be a security risk. | 1275 | If care is not taken, then it can be a security risk. |
1178 | For example, if a certificate request contains a | 1276 | For example, if a certificate request contains a |
1179 | .Em basicConstraints | 1277 | .Em basicConstraints |
1180 | extension with CA:TRUE and the | 1278 | extension with CA:TRUE and the |
@@ -1204,7 +1302,7 @@ to prevent a request supplying its own values. | |||
1204 | Additional restrictions can be placed on the CA certificate itself. | 1302 | Additional restrictions can be placed on the CA certificate itself. |
1205 | For example if the CA certificate has: | 1303 | For example if the CA certificate has: |
1206 | .Pp | 1304 | .Pp |
1207 | \& basicConstraints = CA:TRUE, pathlen:0 | 1305 | .D1 basicConstraints = CA:TRUE, pathlen:0 |
1208 | .Pp | 1306 | .Pp |
1209 | then even if a certificate is issued with CA:TRUE it will not be valid. | 1307 | then even if a certificate is issued with CA:TRUE it will not be valid. |
1210 | .\" | 1308 | .\" |
@@ -1213,10 +1311,8 @@ then even if a certificate is issued with CA:TRUE it will not be valid. | |||
1213 | .Sh CIPHERS | 1311 | .Sh CIPHERS |
1214 | .Nm openssl ciphers | 1312 | .Nm openssl ciphers |
1215 | .Op Fl v | 1313 | .Op Fl v |
1216 | .Op Fl ssl2 | 1314 | .Op Fl ssl2 | ssl3 | tls1 |
1217 | .Op Fl ssl3 | 1315 | .Op Ar cipherlist |
1218 | .Op Fl tls1 | ||
1219 | .Op Cm cipherlist | ||
1220 | .Pp | 1316 | .Pp |
1221 | The | 1317 | The |
1222 | .Nm cipherlist | 1318 | .Nm cipherlist |
@@ -1230,9 +1326,9 @@ The options are as follows: | |||
1230 | .It Fl v | 1326 | .It Fl v |
1231 | Verbose option. | 1327 | Verbose option. |
1232 | List ciphers with a complete description of protocol version | 1328 | List ciphers with a complete description of protocol version |
1233 | (SSLv2 or SSLv3; the latter includes TLS), key exchange, | 1329 | .Pq SSLv2 or SSLv3; the latter includes TLS , |
1234 | authentication, encryption and mac algorithms used along with any key size | 1330 | key exchange, authentication, encryption and mac algorithms used along with |
1235 | restrictions and whether the algorithm is classed as an | 1331 | any key size restrictions and whether the algorithm is classed as an |
1236 | .Em export | 1332 | .Em export |
1237 | cipher. | 1333 | cipher. |
1238 | Note that without the | 1334 | Note that without the |
@@ -1240,15 +1336,15 @@ Note that without the | |||
1240 | option, ciphers may seem to appear twice in a cipher list; | 1336 | option, ciphers may seem to appear twice in a cipher list; |
1241 | this is when similar ciphers are available for | 1337 | this is when similar ciphers are available for |
1242 | SSL v2 and for SSL v3/TLS v1. | 1338 | SSL v2 and for SSL v3/TLS v1. |
1243 | .It Fl ssl3 | ||
1244 | Only include SSL v3 ciphers. | ||
1245 | .It Fl ssl2 | 1339 | .It Fl ssl2 |
1246 | Only include SSL v2 ciphers. | 1340 | Only include SSL v2 ciphers. |
1341 | .It Fl ssl3 | ||
1342 | Only include SSL v3 ciphers. | ||
1247 | .It Fl tls1 | 1343 | .It Fl tls1 |
1248 | Only include TLS v1 ciphers. | 1344 | Only include TLS v1 ciphers. |
1249 | .It Fl h , ? | 1345 | .It Fl h , \&? |
1250 | Print a brief usage message. | 1346 | Print a brief usage message. |
1251 | .It Fl cipherlist | 1347 | .It Ar cipherlist |
1252 | A cipher list to convert to a cipher preference list. | 1348 | A cipher list to convert to a cipher preference list. |
1253 | If it is not included, then the default cipher list will be used. | 1349 | If it is not included, then the default cipher list will be used. |
1254 | The format is described below. | 1350 | The format is described below. |
@@ -1277,7 +1373,7 @@ represents all SSL v3 algorithms. | |||
1277 | Lists of cipher suites can be combined in a single | 1373 | Lists of cipher suites can be combined in a single |
1278 | .Em cipher string | 1374 | .Em cipher string |
1279 | using the | 1375 | using the |
1280 | .Cm + | 1376 | .Sq + |
1281 | character. | 1377 | character. |
1282 | This is used as a logical | 1378 | This is used as a logical |
1283 | .Em and | 1379 | .Em and |
@@ -1287,32 +1383,33 @@ For example, | |||
1287 | represents all cipher suites containing the SHA1 and the DES algorithms. | 1383 | represents all cipher suites containing the SHA1 and the DES algorithms. |
1288 | .Pp | 1384 | .Pp |
1289 | Each cipher string can be optionally preceded by the characters | 1385 | Each cipher string can be optionally preceded by the characters |
1290 | .Cm ! , - | 1386 | .Sq \&! , |
1387 | .Sq - , | ||
1291 | or | 1388 | or |
1292 | .Cm + . | 1389 | .Sq + . |
1293 | .Pp | 1390 | .Pp |
1294 | If | 1391 | If |
1295 | .Cm ! | 1392 | .Sq !\& |
1296 | is used, then the ciphers are permanently deleted from the list. | 1393 | is used, then the ciphers are permanently deleted from the list. |
1297 | The ciphers deleted can never reappear in the list even if they are | 1394 | The ciphers deleted can never reappear in the list even if they are |
1298 | explicitly stated. | 1395 | explicitly stated. |
1299 | .Pp | 1396 | .Pp |
1300 | If | 1397 | If |
1301 | .Cm - | 1398 | .Sq - |
1302 | is used, then the ciphers are deleted from the list, but some or | 1399 | is used, then the ciphers are deleted from the list, but some or |
1303 | all of the ciphers can be added again by later options. | 1400 | all of the ciphers can be added again by later options. |
1304 | .Pp | 1401 | .Pp |
1305 | If | 1402 | If |
1306 | .Cm + | 1403 | .Sq + |
1307 | is used, then the ciphers are moved to the end of the list. | 1404 | is used, then the ciphers are moved to the end of the list. |
1308 | This option doesn't add any new ciphers, it just moves matching existing ones. | 1405 | This option doesn't add any new ciphers, it just moves matching existing ones. |
1309 | .Pp | 1406 | .Pp |
1310 | If none of these characters is present, then the string is just interpreted | 1407 | If none of these characters is present, then the string is just interpreted |
1311 | as a list of ciphers to be appended to the current preference list. | 1408 | as a list of ciphers to be appended to the current preference list. |
1312 | If the list includes any ciphers already present they will be ignored; | 1409 | If the list includes any ciphers already present, they will be ignored; |
1313 | that is, they will not be moved to the end of the list. | 1410 | that is, they will not be moved to the end of the list. |
1314 | .Pp | 1411 | .Pp |
1315 | Additionally the cipher string | 1412 | Additionally, the cipher string |
1316 | .Em @STRENGTH | 1413 | .Em @STRENGTH |
1317 | can be used at any point to sort the current cipher list in order of | 1414 | can be used at any point to sort the current cipher list in order of |
1318 | encryption algorithm key length. | 1415 | encryption algorithm key length. |
@@ -1349,29 +1446,35 @@ The cipher suites not enabled by | |||
1349 | currently being | 1446 | currently being |
1350 | .Ar eNULL . | 1447 | .Ar eNULL . |
1351 | .It Ar HIGH | 1448 | .It Ar HIGH |
1352 | "High" encryption cipher suites. | 1449 | .Qq High |
1450 | encryption cipher suites. | ||
1353 | This currently means those with key lengths larger than 128 bits. | 1451 | This currently means those with key lengths larger than 128 bits. |
1354 | .It Ar MEDIUM | 1452 | .It Ar MEDIUM |
1355 | "Medium" encryption cipher suites, currently those using 128 bit encryption. | 1453 | .Qq Medium |
1454 | encryption cipher suites, currently those using 128-bit encryption. | ||
1356 | .It Ar LOW | 1455 | .It Ar LOW |
1357 | "Low" encryption cipher suites, currently those using 64 or 56 bit encryption | 1456 | .Qq Low |
1457 | encryption cipher suites, currently those using 64- or 56-bit encryption | ||
1358 | algorithms, but excluding export cipher suites. | 1458 | algorithms, but excluding export cipher suites. |
1359 | .It Ar EXP , EXPORT | 1459 | .It Ar EXP , EXPORT |
1360 | Export encryption algorithms. | 1460 | Export encryption algorithms. |
1361 | Including 40 and 56 bits algorithms. | 1461 | Including 40- and 56-bit algorithms. |
1362 | .It Ar EXPORT40 | 1462 | .It Ar EXPORT40 |
1363 | 40 bit export encryption algorithms | 1463 | 40-bit export encryption algorithms |
1364 | .It Ar EXPORT56 | 1464 | .It Ar EXPORT56 |
1365 | 56 bit export encryption algorithms. | 1465 | 56-bit export encryption algorithms. |
1366 | .It Ar eNULL , NULL | 1466 | .It Ar eNULL , NULL |
1367 | The "NULL" ciphers; that is those offering no encryption. | 1467 | The |
1368 | Because these offer no encryption at all and are a security risk | 1468 | .Qq NULL |
1469 | ciphers; that is those offering no encryption. | ||
1470 | Because these offer no encryption at all and are a security risk, | ||
1369 | they are disabled unless explicitly included. | 1471 | they are disabled unless explicitly included. |
1370 | .It Ar aNULL | 1472 | .It Ar aNULL |
1371 | The cipher suites offering no authentication. | 1473 | The cipher suites offering no authentication. |
1372 | This is currently the anonymous DH algorithms. | 1474 | This is currently the anonymous DH algorithms. |
1373 | These cipher suites are vulnerable to a "man in the middle" | 1475 | These cipher suites are vulnerable to a |
1374 | attack and so their use is normally discouraged. | 1476 | .Qq man in the middle |
1477 | attack, so their use is normally discouraged. | ||
1375 | .It Ar kRSA , RSA | 1478 | .It Ar kRSA , RSA |
1376 | Cipher suites using RSA key exchange. | 1479 | Cipher suites using RSA key exchange. |
1377 | .It Ar kEDH | 1480 | .It Ar kEDH |
@@ -1389,7 +1492,7 @@ Cipher suites effectively using DH authentication, i.e. the certificates carry | |||
1389 | DH keys. | 1492 | DH keys. |
1390 | Not implemented. | 1493 | Not implemented. |
1391 | .It Ar kFZA , aFZA , eFZA , FZA | 1494 | .It Ar kFZA , aFZA , eFZA , FZA |
1392 | Ciphers suites using FORTEZZA key exchange, authentication, encryption | 1495 | Cipher suites using FORTEZZA key exchange, authentication, encryption |
1393 | or all FORTEZZA algorithms. | 1496 | or all FORTEZZA algorithms. |
1394 | Not implemented. | 1497 | Not implemented. |
1395 | .It Ar TLSv1 , SSLv3 , SSLv2 | 1498 | .It Ar TLSv1 , SSLv3 , SSLv2 |
@@ -1403,13 +1506,12 @@ Cipher suites using AES. | |||
1403 | .It Ar 3DES | 1506 | .It Ar 3DES |
1404 | Cipher suites using triple DES. | 1507 | Cipher suites using triple DES. |
1405 | .It Ar DES | 1508 | .It Ar DES |
1406 | Cipher suites using DES (not triple DES). | 1509 | Cipher suites using DES |
1510 | .Pq not triple DES . | ||
1407 | .It Ar RC4 | 1511 | .It Ar RC4 |
1408 | Cipher suites using RC4. | 1512 | Cipher suites using RC4. |
1409 | .It Ar RC2 | 1513 | .It Ar RC2 |
1410 | Cipher suites using RC2. | 1514 | Cipher suites using RC2. |
1411 | .It Ar IDEA | ||
1412 | Cipher suites using IDEA. | ||
1413 | .It Ar MD5 | 1515 | .It Ar MD5 |
1414 | Cipher suites using MD5. | 1516 | Cipher suites using MD5. |
1415 | .It Ar SHA1 , SHA | 1517 | .It Ar SHA1 , SHA |
@@ -1423,122 +1525,111 @@ equivalents. | |||
1423 | It should be noted that several cipher suite names do not include the | 1525 | It should be noted that several cipher suite names do not include the |
1424 | authentication used, e.g. DES-CBC3-SHA. | 1526 | authentication used, e.g. DES-CBC3-SHA. |
1425 | In these cases, RSA authentication is used. | 1527 | In these cases, RSA authentication is used. |
1426 | .Pp | 1528 | .Ss SSL v3.0 cipher suites |
1427 | .Sy "SSL v3.0 cipher suites" | 1529 | .Bd -unfilled -offset indent |
1428 | .Bd -literal | 1530 | SSL_RSA_WITH_NULL_MD5 NULL-MD5 |
1429 | SSL_RSA_WITH_NULL_MD5 NULL-MD5 | 1531 | SSL_RSA_WITH_NULL_SHA NULL-SHA |
1430 | SSL_RSA_WITH_NULL_SHA NULL-SHA | 1532 | SSL_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5 |
1431 | SSL_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5 | 1533 | SSL_RSA_WITH_RC4_128_MD5 RC4-MD5 |
1432 | SSL_RSA_WITH_RC4_128_MD5 RC4-MD5 | 1534 | SSL_RSA_WITH_RC4_128_SHA RC4-SHA |
1433 | SSL_RSA_WITH_RC4_128_SHA RC4-SHA | 1535 | SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5 |
1434 | SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5 | 1536 | SSL_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA |
1435 | SSL_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA | 1537 | SSL_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA |
1436 | SSL_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA | 1538 | SSL_RSA_WITH_DES_CBC_SHA DES-CBC-SHA |
1437 | SSL_RSA_WITH_DES_CBC_SHA DES-CBC-SHA | 1539 | SSL_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA |
1438 | SSL_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA | 1540 | |
1439 | .Ed | 1541 | SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented. |
1440 | .Bd -literal | 1542 | SSL_DH_DSS_WITH_DES_CBC_SHA Not implemented. |
1441 | SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented. | 1543 | SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented. |
1442 | SSL_DH_DSS_WITH_DES_CBC_SHA Not implemented. | 1544 | SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented. |
1443 | SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented. | 1545 | SSL_DH_RSA_WITH_DES_CBC_SHA Not implemented. |
1444 | SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented. | 1546 | SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented. |
1445 | SSL_DH_RSA_WITH_DES_CBC_SHA Not implemented. | 1547 | SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA |
1446 | SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented. | 1548 | SSL_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA |
1447 | SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA | 1549 | SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA |
1448 | SSL_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA | 1550 | SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA |
1449 | SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA | 1551 | SSL_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA |
1450 | SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA | 1552 | SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA |
1451 | SSL_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA | 1553 | |
1452 | SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA | 1554 | SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 |
1453 | .Ed | 1555 | SSL_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 |
1454 | .Bd -literal | 1556 | SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA |
1455 | SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 | 1557 | SSL_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA |
1456 | SSL_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 | 1558 | SSL_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA |
1457 | SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA | 1559 | |
1458 | SSL_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA | 1560 | SSL_FORTEZZA_KEA_WITH_NULL_SHA Not implemented. |
1459 | SSL_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA | 1561 | SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA Not implemented. |
1460 | .Ed | 1562 | SSL_FORTEZZA_KEA_WITH_RC4_128_SHA Not implemented. |
1461 | .Bd -literal | ||
1462 | SSL_FORTEZZA_KEA_WITH_NULL_SHA Not implemented. | ||
1463 | SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA Not implemented. | ||
1464 | SSL_FORTEZZA_KEA_WITH_RC4_128_SHA Not implemented. | ||
1465 | .Ed | ||
1466 | .Pp | ||
1467 | .Sy "TLS v1.0 cipher suites" | ||
1468 | .Bd -literal | ||
1469 | TLS_RSA_WITH_NULL_MD5 NULL-MD5 | ||
1470 | TLS_RSA_WITH_NULL_SHA NULL-SHA | ||
1471 | TLS_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5 | ||
1472 | TLS_RSA_WITH_RC4_128_MD5 RC4-MD5 | ||
1473 | TLS_RSA_WITH_RC4_128_SHA RC4-SHA | ||
1474 | TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5 | ||
1475 | TLS_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA | ||
1476 | TLS_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA | ||
1477 | TLS_RSA_WITH_DES_CBC_SHA DES-CBC-SHA | ||
1478 | TLS_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA | ||
1479 | .Ed | ||
1480 | .Bd -literal | ||
1481 | TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented. | ||
1482 | TLS_DH_DSS_WITH_DES_CBC_SHA Not implemented. | ||
1483 | TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented. | ||
1484 | TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented. | ||
1485 | TLS_DH_RSA_WITH_DES_CBC_SHA Not implemented. | ||
1486 | TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented. | ||
1487 | TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA | ||
1488 | TLS_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA | ||
1489 | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA | ||
1490 | TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA | ||
1491 | TLS_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA | ||
1492 | TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA | ||
1493 | .Ed | 1563 | .Ed |
1494 | .Bd -literal | 1564 | .Ss TLS v1.0 cipher suites |
1495 | TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 | 1565 | .Bd -unfilled -offset indent |
1496 | TLS_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 | 1566 | TLS_RSA_WITH_NULL_MD5 NULL-MD5 |
1497 | TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA | 1567 | TLS_RSA_WITH_NULL_SHA NULL-SHA |
1498 | TLS_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA | 1568 | TLS_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5 |
1499 | TLS_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA | 1569 | TLS_RSA_WITH_RC4_128_MD5 RC4-MD5 |
1570 | TLS_RSA_WITH_RC4_128_SHA RC4-SHA | ||
1571 | TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5 | ||
1572 | TLS_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA | ||
1573 | TLS_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA | ||
1574 | TLS_RSA_WITH_DES_CBC_SHA DES-CBC-SHA | ||
1575 | TLS_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA | ||
1576 | |||
1577 | TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented. | ||
1578 | TLS_DH_DSS_WITH_DES_CBC_SHA Not implemented. | ||
1579 | TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented. | ||
1580 | TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented. | ||
1581 | TLS_DH_RSA_WITH_DES_CBC_SHA Not implemented. | ||
1582 | TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented. | ||
1583 | TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA | ||
1584 | TLS_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA | ||
1585 | TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA | ||
1586 | TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA | ||
1587 | TLS_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA | ||
1588 | TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA | ||
1589 | |||
1590 | TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5 | ||
1591 | TLS_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5 | ||
1592 | TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA | ||
1593 | TLS_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA | ||
1594 | TLS_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA | ||
1500 | .Ed | 1595 | .Ed |
1501 | .Pp | 1596 | .Ss AES ciphersuites from RFC 3268, extending TLS v1.0 |
1502 | .Sy "AES ciphersuites from RFC 3268, extending TLS v1.0" | 1597 | .Bd -unfilled -offset indent |
1503 | .Bd -literal | 1598 | TLS_RSA_WITH_AES_128_CBC_SHA AES128-SHA |
1504 | TLS_RSA_WITH_AES_128_CBC_SHA AES128-SHA | 1599 | TLS_RSA_WITH_AES_256_CBC_SHA AES256-SHA |
1505 | TLS_RSA_WITH_AES_256_CBC_SHA AES256-SHA | ||
1506 | 1600 | ||
1507 | TLS_DH_DSS_WITH_AES_128_CBC_SHA DH-DSS-AES128-SHA | 1601 | TLS_DH_DSS_WITH_AES_128_CBC_SHA DH-DSS-AES128-SHA |
1508 | TLS_DH_DSS_WITH_AES_256_CBC_SHA DH-DSS-AES256-SHA | 1602 | TLS_DH_DSS_WITH_AES_256_CBC_SHA DH-DSS-AES256-SHA |
1509 | TLS_DH_RSA_WITH_AES_128_CBC_SHA DH-RSA-AES128-SHA | 1603 | TLS_DH_RSA_WITH_AES_128_CBC_SHA DH-RSA-AES128-SHA |
1510 | TLS_DH_RSA_WITH_AES_256_CBC_SHA DH-RSA-AES256-SHA | 1604 | TLS_DH_RSA_WITH_AES_256_CBC_SHA DH-RSA-AES256-SHA |
1511 | 1605 | ||
1512 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE-DSS-AES128-SHA | 1606 | TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE-DSS-AES128-SHA |
1513 | TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE-DSS-AES256-SHA | 1607 | TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE-DSS-AES256-SHA |
1514 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE-RSA-AES128-SHA | 1608 | TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE-RSA-AES128-SHA |
1515 | TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA | 1609 | TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA |
1516 | 1610 | ||
1517 | TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA | 1611 | TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA |
1518 | TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA | 1612 | TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA |
1519 | .Ed | 1613 | .Ed |
1520 | .Pp | 1614 | .Ss Additional Export 1024 and other cipher suites |
1521 | .Sy "Additional Export 1024 and other cipher suites" | ||
1522 | .Pp | ||
1523 | .Sy Note : | 1615 | .Sy Note : |
1524 | These ciphers can also be used in SSL v3. | 1616 | These ciphers can also be used in SSL v3. |
1525 | .Bd -literal | 1617 | .Bd -unfilled -offset indent |
1526 | TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DES-CBC-SHA | 1618 | TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DES-CBC-SHA |
1527 | TLS_RSA_EXPORT1024_WITH_RC4_56_SHA EXP1024-RC4-SHA | 1619 | TLS_RSA_EXPORT1024_WITH_RC4_56_SHA EXP1024-RC4-SHA |
1528 | TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DHE-DSS-DES-CBC-SHA | 1620 | TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DHE-DSS-DES-CBC-SHA |
1529 | TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA EXP1024-DHE-DSS-RC4-SHA | 1621 | TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA EXP1024-DHE-DSS-RC4-SHA |
1530 | TLS_DHE_DSS_WITH_RC4_128_SHA DHE-DSS-RC4-SHA | 1622 | TLS_DHE_DSS_WITH_RC4_128_SHA DHE-DSS-RC4-SHA |
1531 | .Ed | 1623 | .Ed |
1532 | .Pp | 1624 | .Ss SSL v2.0 cipher suites |
1533 | .Sy "SSL v2.0 cipher suites" | 1625 | .Bd -unfilled -offset indent |
1534 | .Bd -literal | 1626 | SSL_CK_RC4_128_WITH_MD5 RC4-MD5 |
1535 | SSL_CK_RC4_128_WITH_MD5 RC4-MD5 | 1627 | SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5 |
1536 | SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5 | 1628 | SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5 |
1537 | SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5 | 1629 | SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5 |
1538 | SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5 | 1630 | SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5 |
1539 | SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5 | 1631 | SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5 |
1540 | SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5 | 1632 | SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5 |
1541 | SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5 | ||
1542 | .Ed | 1633 | .Ed |
1543 | .Sh CIPHERS NOTES | 1634 | .Sh CIPHERS NOTES |
1544 | The non-ephemeral DH modes are currently unimplemented in | 1635 | The non-ephemeral DH modes are currently unimplemented in |
@@ -1554,25 +1645,25 @@ Verbose listing of all | |||
1554 | .Nm OpenSSL | 1645 | .Nm OpenSSL |
1555 | ciphers including NULL ciphers: | 1646 | ciphers including NULL ciphers: |
1556 | .Pp | 1647 | .Pp |
1557 | \& $ openssl ciphers -v 'ALL:eNULL' | 1648 | .Dl $ openssl ciphers -v 'ALL:eNULL' |
1558 | .Pp | 1649 | .Pp |
1559 | Include all ciphers except NULL and anonymous DH then sort by | 1650 | Include all ciphers except NULL and anonymous DH then sort by |
1560 | strength: | 1651 | strength: |
1561 | .Pp | 1652 | .Pp |
1562 | \& $ openssl ciphers -v 'ALL:!ADH:@STRENGTH' | 1653 | .Dl $ openssl ciphers -v 'ALL:!ADH:@STRENGTH' |
1563 | .Pp | 1654 | .Pp |
1564 | Include only 3DES ciphers and then place RSA ciphers last: | 1655 | Include only 3DES ciphers and then place RSA ciphers last: |
1565 | .Pp | 1656 | .Pp |
1566 | \& $ openssl ciphers -v '3DES:+RSA' | 1657 | .Dl $ openssl ciphers -v '3DES:+RSA' |
1567 | .Pp | 1658 | .Pp |
1568 | Include all RC4 ciphers but leave out those without authentication: | 1659 | Include all RC4 ciphers but leave out those without authentication: |
1569 | .Pp | 1660 | .Pp |
1570 | \& $ openssl ciphers -v 'RC4:!COMPLEMENTOFDEFAULT' | 1661 | .Dl $ openssl ciphers -v 'RC4:!COMPLEMENTOFDEFAULT' |
1571 | .Pp | 1662 | .Pp |
1572 | Include all ciphers with RSA authentication but leave out ciphers without | 1663 | Include all ciphers with RSA authentication but leave out ciphers without |
1573 | encryption: | 1664 | encryption: |
1574 | .Pp | 1665 | .Pp |
1575 | \& $ openssl ciphers -v 'RSA:!COMPLEMENTOFALL' | 1666 | .Dl $ openssl ciphers -v 'RSA:!COMPLEMENTOFALL' |
1576 | .Sh CIPHERS HISTORY | 1667 | .Sh CIPHERS HISTORY |
1577 | The | 1668 | The |
1578 | .Ar COMPLENTOFALL | 1669 | .Ar COMPLENTOFALL |
@@ -1584,18 +1675,21 @@ selection options were added in version 0.9.7. | |||
1584 | .\" | 1675 | .\" |
1585 | .Sh CRL | 1676 | .Sh CRL |
1586 | .Nm openssl crl | 1677 | .Nm openssl crl |
1587 | .Op Fl inform Ar PEM|DER | 1678 | .Bk -words |
1588 | .Op Fl outform Ar PEM|DER | 1679 | .Op Fl inform Ar DER | PEM |
1680 | .Op Fl outform Ar DER | PEM | ||
1589 | .Op Fl text | 1681 | .Op Fl text |
1590 | .Op Fl in Ar filename | 1682 | .Op Fl in Ar filename |
1591 | .Op Fl out Ar filename | 1683 | .Op Fl out Ar filename |
1592 | .Op Fl noout | 1684 | .Op Fl noout |
1593 | .Op Fl hash | 1685 | .Op Fl hash |
1686 | .Op Fl fingerprint | ||
1594 | .Op Fl issuer | 1687 | .Op Fl issuer |
1595 | .Op Fl lastupdate | 1688 | .Op Fl lastupdate |
1596 | .Op Fl nextupdate | 1689 | .Op Fl nextupdate |
1597 | .Op Cm CAfile Ar file | 1690 | .Op Cm CAfile Ar file |
1598 | .Op Cm CApath Ar dir | 1691 | .Op Cm CApath Ar dir |
1692 | .Ek | ||
1599 | .Pp | 1693 | .Pp |
1600 | The | 1694 | The |
1601 | .Nm crl | 1695 | .Nm crl |
@@ -1607,14 +1701,14 @@ format. | |||
1607 | .Pp | 1701 | .Pp |
1608 | The options are as follows: | 1702 | The options are as follows: |
1609 | .Bl -tag -width "XXXX" | 1703 | .Bl -tag -width "XXXX" |
1610 | .It Fl inform Ar DER|PEM | 1704 | .It Fl inform Ar DER | PEM |
1611 | This specifies the input format. | 1705 | This specifies the input format. |
1612 | .Ar DER | 1706 | .Ar DER |
1613 | format is DER encoded CRL structure. | 1707 | format is a DER encoded CRL structure. |
1614 | .Ar PEM | 1708 | .Ar PEM |
1615 | (the default) is a base64 encoded version of the DER form with header | 1709 | .Pq the default |
1616 | and footer lines. | 1710 | is a base64 encoded version of the DER form with header and footer lines. |
1617 | .It Fl outform Ar DER|PEM | 1711 | .It Fl outform Ar DER | PEM |
1618 | This specifies the output format; the options have the same meaning as the | 1712 | This specifies the output format; the options have the same meaning as the |
1619 | .Fl inform | 1713 | .Fl inform |
1620 | option. | 1714 | option. |
@@ -1631,6 +1725,8 @@ Don't output the encoded version of the CRL. | |||
1631 | .It Fl hash | 1725 | .It Fl hash |
1632 | Output a hash of the issuer name. | 1726 | Output a hash of the issuer name. |
1633 | This can be used to lookup CRLs in a directory by issuer name. | 1727 | This can be used to lookup CRLs in a directory by issuer name. |
1728 | .It Fl fingerprint | ||
1729 | Print the CRL fingerprint. | ||
1634 | .It Fl issuer | 1730 | .It Fl issuer |
1635 | Output the issuer name. | 1731 | Output the issuer name. |
1636 | .It Fl lastupdate | 1732 | .It Fl lastupdate |
@@ -1654,9 +1750,9 @@ should be linked to each certificate. | |||
1654 | .El | 1750 | .El |
1655 | .Sh CRL NOTES | 1751 | .Sh CRL NOTES |
1656 | The PEM CRL format uses the header and footer lines: | 1752 | The PEM CRL format uses the header and footer lines: |
1657 | .Bd -literal | 1753 | .Bd -unfilled -offset indent |
1658 | \& -----BEGIN X509 CRL----- | 1754 | -----BEGIN X509 CRL----- |
1659 | \& -----END X509 CRL----- | 1755 | -----END X509 CRL----- |
1660 | .Ed | 1756 | .Ed |
1661 | .Sh CRL EXAMPLES | 1757 | .Sh CRL EXAMPLES |
1662 | Convert a CRL file from | 1758 | Convert a CRL file from |
@@ -1664,23 +1760,23 @@ Convert a CRL file from | |||
1664 | to | 1760 | to |
1665 | .Ar DER : | 1761 | .Ar DER : |
1666 | .Pp | 1762 | .Pp |
1667 | \& $ openssl crl -in crl.pem -outform DER -out crl.der | 1763 | .Dl $ openssl crl -in crl.pem -outform DER -out crl.der |
1668 | .Pp | 1764 | .Pp |
1669 | Output the text form of a | 1765 | Output the text form of a |
1670 | .Ar DER | 1766 | .Ar DER |
1671 | encoded certificate: | 1767 | encoded certificate: |
1672 | .Pp | 1768 | .Pp |
1673 | \& $ openssl crl -in crl.der -text -noout | 1769 | .Dl $ openssl crl -in crl.der -text -noout |
1674 | .Sh CRL BUGS | 1770 | .Sh CRL BUGS |
1675 | Ideally it should be possible to create a CRL using appropriate options | 1771 | Ideally, it should be possible to create a CRL using appropriate options |
1676 | and files too. | 1772 | and files too. |
1677 | .\" | 1773 | .\" |
1678 | .\" CRL2PKCS7 | 1774 | .\" CRL2PKCS7 |
1679 | .\" | 1775 | .\" |
1680 | .Sh CRL2PKCS7 | 1776 | .Sh CRL2PKCS7 |
1681 | .Nm openssl crl2pkcs7 | 1777 | .Nm openssl crl2pkcs7 |
1682 | .Op Fl inform Ar PEM|DER | 1778 | .Op Fl inform Ar DER | PEM |
1683 | .Op Fl outform Ar PEM|DER | 1779 | .Op Fl outform Ar DER | PEM |
1684 | .Op Fl in Ar filename | 1780 | .Op Fl in Ar filename |
1685 | .Op Fl out Ar filename | 1781 | .Op Fl out Ar filename |
1686 | .Op Fl certfile Ar filename | 1782 | .Op Fl certfile Ar filename |
@@ -1690,24 +1786,25 @@ The | |||
1690 | .Nm crl2pkcs7 | 1786 | .Nm crl2pkcs7 |
1691 | command takes an optional CRL and one or more | 1787 | command takes an optional CRL and one or more |
1692 | certificates and converts them into a PKCS#7 degenerate | 1788 | certificates and converts them into a PKCS#7 degenerate |
1693 | "certificates only" structure. | 1789 | .Qq certificates only |
1790 | structure. | ||
1694 | .Pp | 1791 | .Pp |
1695 | The options are as follows: | 1792 | The options are as follows: |
1696 | .Bl -tag -width "XXXX" | 1793 | .Bl -tag -width "XXXX" |
1697 | .It Fl inform Ar DER|PEM | 1794 | .It Fl inform Ar DER | PEM |
1698 | This specifies the CRL input format. | 1795 | This specifies the CRL input format. |
1699 | .Ar DER | 1796 | .Ar DER |
1700 | format is DER encoded CRL structure. | 1797 | format is a DER encoded CRL structure. |
1701 | .Ar PEM | 1798 | .Ar PEM |
1702 | (the default) is a base64 encoded version of the DER form with header | 1799 | .Pq the default |
1703 | and footer lines. | 1800 | is a base64 encoded version of the DER form with header and footer lines. |
1704 | .It Fl outform Ar DER|PEM | 1801 | .It Fl outform Ar DER | PEM |
1705 | This specifies the PKCS#7 structure output format. | 1802 | This specifies the PKCS#7 structure output format. |
1706 | .Ar DER | 1803 | .Ar DER |
1707 | format is DER encoded PKCS#7 structure. | 1804 | format is a DER encoded PKCS#7 structure. |
1708 | .Ar PEM | 1805 | .Ar PEM |
1709 | (the default) is a base64 encoded version of the DER form with header | 1806 | .Pq the default |
1710 | and footer lines. | 1807 | is a base64 encoded version of the DER form with header and footer lines. |
1711 | .It Fl in Ar filename | 1808 | .It Fl in Ar filename |
1712 | This specifies the input | 1809 | This specifies the input |
1713 | .Ar filename | 1810 | .Ar filename |
@@ -1723,25 +1820,25 @@ containing one or more certificates in | |||
1723 | .Ar PEM | 1820 | .Ar PEM |
1724 | format. | 1821 | format. |
1725 | All certificates in the file will be added to the PKCS#7 structure. | 1822 | All certificates in the file will be added to the PKCS#7 structure. |
1726 | This option can be used more than once to read certificates form multiple | 1823 | This option can be used more than once to read certificates from multiple |
1727 | files. | 1824 | files. |
1728 | .It Fl nocrl | 1825 | .It Fl nocrl |
1729 | Normally a CRL is included in the output file. | 1826 | Normally, a CRL is included in the output file. |
1730 | With this option, no CRL is | 1827 | With this option, no CRL is |
1731 | included in the output file and a CRL is not read from the input file. | 1828 | included in the output file and a CRL is not read from the input file. |
1732 | .El | 1829 | .El |
1733 | .Sh CRL2PKCS7 EXAMPLES | 1830 | .Sh CRL2PKCS7 EXAMPLES |
1734 | Create a PKCS#7 structure from a certificate and CRL: | 1831 | Create a PKCS#7 structure from a certificate and CRL: |
1735 | .Pp | 1832 | .Pp |
1736 | \& $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem | 1833 | .Dl $ openssl crl2pkcs7 -in crl.pem -certfile cert.pem -out p7.pem |
1737 | .Pp | 1834 | .Pp |
1738 | Creates a PKCS#7 structure in | 1835 | Create a PKCS#7 structure in |
1739 | .Ar DER | 1836 | .Ar DER |
1740 | format with no CRL from several | 1837 | format with no CRL from several |
1741 | different certificates: | 1838 | different certificates: |
1742 | .Bd -literal | 1839 | .Bd -literal -offset indent |
1743 | \& $ openssl crl2pkcs7 -nocrl -certfile newcert.pem | 1840 | $ openssl crl2pkcs7 -nocrl -certfile newcert.pem \e |
1744 | \& -certfile demoCA/cacert.pem -outform DER -out p7.der | 1841 | -certfile demoCA/cacert.pem -outform DER -out p7.der |
1745 | .Ed | 1842 | .Ed |
1746 | .Sh CRL2PKCS7 NOTES | 1843 | .Sh CRL2PKCS7 NOTES |
1747 | The output file is a PKCS#7 signed data structure containing no signers and | 1844 | The output file is a PKCS#7 signed data structure containing no signers and |
@@ -1762,7 +1859,11 @@ install user certificates and CAs in MSIE using the Xenroll control. | |||
1762 | .\" | 1859 | .\" |
1763 | .Sh DGST | 1860 | .Sh DGST |
1764 | .Nm openssl dgst | 1861 | .Nm openssl dgst |
1765 | .Op Cm -md5|-md4|-md2|-sha1|-sha|-mdc2|-ripemd160|-dss1 | 1862 | .Bk -words |
1863 | .Oo | ||
1864 | .Fl md5 | md4 | md2 | sha1 | | ||
1865 | .Fl sha | ripemd160 | dss1 | ||
1866 | .Oc | ||
1766 | .Op Fl c | 1867 | .Op Fl c |
1767 | .Op Fl d | 1868 | .Op Fl d |
1768 | .Op Fl hex | 1869 | .Op Fl hex |
@@ -1773,9 +1874,16 @@ install user certificates and CAs in MSIE using the Xenroll control. | |||
1773 | .Op Fl prverify Ar filename | 1874 | .Op Fl prverify Ar filename |
1774 | .Op Fl rand Ar file ... | 1875 | .Op Fl rand Ar file ... |
1775 | .Op Fl signature Ar filename | 1876 | .Op Fl signature Ar filename |
1877 | .Op Fl engine Ar id | ||
1878 | .Op Fl keyform Ar PEM | ENGINE | ||
1776 | .Op Ar file ... | 1879 | .Op Ar file ... |
1880 | .Ek | ||
1777 | .Pp | 1881 | .Pp |
1778 | .Cm md5|md4|md2|sha1|sha|mdc2|ripemd160 | 1882 | .Nm openssl |
1883 | .Xo | ||
1884 | .Cm md5 | md4 | md2 | sha1 | | ||
1885 | .Cm sha | ripemd160 | ||
1886 | .Xc | ||
1779 | .Op Fl c | 1887 | .Op Fl c |
1780 | .Op Fl d | 1888 | .Op Fl d |
1781 | .Op Ar file ... | 1889 | .Op Ar file ... |
@@ -1790,14 +1898,15 @@ They can also be used for digital signing and verification. | |||
1790 | The options are as follows: | 1898 | The options are as follows: |
1791 | .Bl -tag -width "XXXX" | 1899 | .Bl -tag -width "XXXX" |
1792 | .It Fl c | 1900 | .It Fl c |
1793 | Print out the digest in two digit groups separated by colons, only relevant if | 1901 | Print out the digest in two-digit groups separated by colons; only relevant if |
1794 | .Em hex | 1902 | .Em hex |
1795 | format output is used. | 1903 | format output is used. |
1796 | .It Fl d | 1904 | .It Fl d |
1797 | Print out BIO debugging information. | 1905 | Print out BIO debugging information. |
1798 | .It Fl hex | 1906 | .It Fl hex |
1799 | Digest is to be output as a hex dump. | 1907 | Digest is to be output as a hex dump. |
1800 | This is the default case for a "normal" | 1908 | This is the default case for a |
1909 | .Qq normal | ||
1801 | digest as opposed to a digital signature. | 1910 | digest as opposed to a digital signature. |
1802 | .It Fl binary | 1911 | .It Fl binary |
1803 | Output the digest or signature in binary form. | 1912 | Output the digest or signature in binary form. |
@@ -1809,28 +1918,31 @@ Digitally sign the digest using the private key in | |||
1809 | .It Fl verify Ar filename | 1918 | .It Fl verify Ar filename |
1810 | Verify the signature using the public key in | 1919 | Verify the signature using the public key in |
1811 | .Ar filename . | 1920 | .Ar filename . |
1812 | The output is either "Verification OK" or "Verification Failure". | 1921 | The output is either |
1922 | .Qq Verification OK | ||
1923 | or | ||
1924 | .Qq Verification Failure . | ||
1813 | .It Fl prverify Ar filename | 1925 | .It Fl prverify Ar filename |
1814 | Verify the signature using the private key in | 1926 | Verify the signature using the private key in |
1815 | .Ar filename . | 1927 | .Ar filename . |
1816 | .It Fl rand Ar file ... | 1928 | .It Fl rand Ar file ... |
1817 | A | 1929 | A file or files containing random data used to seed the random number |
1818 | .Ar file | ||
1819 | or | ||
1820 | .Ar file Ns Li s | ||
1821 | containing random data used to seed the random number | ||
1822 | generator, or an EGD socket (see | 1930 | generator, or an EGD socket (see |
1823 | .Xr RAND_egd 3 ) . | 1931 | .Xr RAND_egd 3 ) . |
1824 | Multiple files can be specified separated by an OS-dependent character. | 1932 | Multiple files can be specified separated by a |
1825 | The separator is | 1933 | .Sq \&: . |
1826 | .Cm \&; | ||
1827 | for MS-Windows, | ||
1828 | .Cm \&, | ||
1829 | for OpenVMS, and | ||
1830 | .Cm \&: | ||
1831 | for all others. | ||
1832 | .It Fl signature Ar filename | 1934 | .It Fl signature Ar filename |
1833 | The actual signature to verify. | 1935 | The actual signature to verify. |
1936 | .It Fl engine Ar id | ||
1937 | Specifying an engine (by it's unique | ||
1938 | .Ar id | ||
1939 | string) will cause | ||
1940 | .Nm dgst | ||
1941 | to attempt to obtain a functional reference to the specified engine, | ||
1942 | thus initialising it if needed. | ||
1943 | The engine will then be set as the default for all available algorithms. | ||
1944 | .It Fl keyform Ar PEM | ENGINE | ||
1945 | Key file format. | ||
1834 | .It Ar file ... | 1946 | .It Ar file ... |
1835 | File or files to digest. | 1947 | File or files to digest. |
1836 | If no files are specified then standard input is used. | 1948 | If no files are specified then standard input is used. |
@@ -1839,7 +1951,7 @@ If no files are specified then standard input is used. | |||
1839 | The digest of choice for all new applications is SHA1. | 1951 | The digest of choice for all new applications is SHA1. |
1840 | Other digests are, however, still widely used. | 1952 | Other digests are, however, still widely used. |
1841 | .Pp | 1953 | .Pp |
1842 | If you wish to sign or verify data using the DSA algorithm then the dss1 | 1954 | If you wish to sign or verify data using the DSA algorithm, then the dss1 |
1843 | digest must be used. | 1955 | digest must be used. |
1844 | .Pp | 1956 | .Pp |
1845 | A source of random numbers is required for certain signing algorithms, in | 1957 | A source of random numbers is required for certain signing algorithms, in |
@@ -1851,7 +1963,8 @@ being signed or verified. | |||
1851 | .\" DH | 1963 | .\" DH |
1852 | .\" | 1964 | .\" |
1853 | .Sh DH | 1965 | .Sh DH |
1854 | Diffie-Hellman Parameter Management. The | 1966 | Diffie-Hellman Parameter Management. |
1967 | The | ||
1855 | .Nm dh | 1968 | .Nm dh |
1856 | command has been replaced by | 1969 | command has been replaced by |
1857 | .Nm dhparam . | 1970 | .Nm dhparam . |
@@ -1864,16 +1977,15 @@ below. | |||
1864 | .Sh DHPARAM | 1977 | .Sh DHPARAM |
1865 | .Nm openssl dhparam | 1978 | .Nm openssl dhparam |
1866 | .Bk -words | 1979 | .Bk -words |
1867 | .Op Fl inform Ar DER|PEM | 1980 | .Op Fl inform Ar DER | PEM |
1868 | .Op Fl outform Ar DER|PEM | 1981 | .Op Fl outform Ar DER | PEM |
1869 | .Op Fl in Ar filename | 1982 | .Op Fl in Ar filename |
1870 | .Op Fl out Ar filename | 1983 | .Op Fl out Ar filename |
1871 | .Op Fl dsaparam | 1984 | .Op Fl dsaparam |
1872 | .Op Fl noout | 1985 | .Op Fl noout |
1873 | .Op Fl text | 1986 | .Op Fl text |
1874 | .Op Fl C | 1987 | .Op Fl C |
1875 | .Op Fl 2 | 1988 | .Op Fl 2 | 5 |
1876 | .Op Fl 5 | ||
1877 | .Op Fl rand Ar file ... | 1989 | .Op Fl rand Ar file ... |
1878 | .Op Fl engine Ar id | 1990 | .Op Fl engine Ar id |
1879 | .Op Ar numbits | 1991 | .Op Ar numbits |
@@ -1885,7 +1997,7 @@ command is used to manipulate DH parameter files. | |||
1885 | .Pp | 1997 | .Pp |
1886 | The options are as follows: | 1998 | The options are as follows: |
1887 | .Bl -tag -width "XXXX" | 1999 | .Bl -tag -width "XXXX" |
1888 | .It Fl inform Ar DER|PEM | 2000 | .It Fl inform Ar DER | PEM |
1889 | This specifies the input format. | 2001 | This specifies the input format. |
1890 | The argument | 2002 | The argument |
1891 | .Ar DER | 2003 | .Ar DER |
@@ -1896,8 +2008,8 @@ The | |||
1896 | form is the default format: | 2008 | form is the default format: |
1897 | it consists of the DER format base64 encoded with | 2009 | it consists of the DER format base64 encoded with |
1898 | additional header and footer lines. | 2010 | additional header and footer lines. |
1899 | .It Fl outform Ar DER|PEM | 2011 | .It Fl outform Ar DER | PEM |
1900 | This specifies the output format, the options have the same meaning as the | 2012 | This specifies the output format; the options have the same meaning as the |
1901 | .Fl inform | 2013 | .Fl inform |
1902 | option. | 2014 | option. |
1903 | .It Fl in Ar filename | 2015 | .It Fl in Ar filename |
@@ -1915,7 +2027,10 @@ be the same as the input filename. | |||
1915 | .It Fl dsaparam | 2027 | .It Fl dsaparam |
1916 | If this option is used, DSA rather than DH parameters are read or created; | 2028 | If this option is used, DSA rather than DH parameters are read or created; |
1917 | they are converted to DH format. | 2029 | they are converted to DH format. |
1918 | Otherwise, "strong" primes (such that (p-1)/2 is also prime) | 2030 | Otherwise, |
2031 | .Qq strong | ||
2032 | primes | ||
2033 | .Pq such that (p-1)/2 is also prime | ||
1919 | will be used for DH parameter generation. | 2034 | will be used for DH parameter generation. |
1920 | .Pp | 2035 | .Pp |
1921 | DH parameter generation with the | 2036 | DH parameter generation with the |
@@ -1929,29 +2044,19 @@ avoid small-subgroup attacks that may be possible otherwise. | |||
1929 | .It Fl 2 , 5 | 2044 | .It Fl 2 , 5 |
1930 | The generator to use, either 2 or 5. | 2045 | The generator to use, either 2 or 5. |
1931 | 2 is the default. | 2046 | 2 is the default. |
1932 | If present then the input file is ignored and parameters are generated instead. | 2047 | If present, then the input file is ignored and parameters are generated instead. |
1933 | .It Fl rand Ar file ... | 2048 | .It Fl rand Ar file ... |
1934 | A | 2049 | A file or files containing random data used to seed the random number generator, |
1935 | .Ar file | ||
1936 | or | ||
1937 | .Ar file Ns Li s | ||
1938 | containing random data used to seed the random number generator, | ||
1939 | or an EGD socket (see | 2050 | or an EGD socket (see |
1940 | .Xr RAND_egd 3 ) . | 2051 | .Xr RAND_egd 3 ) . |
1941 | Multiple files can be specified, separated by an OS-dependent character. | 2052 | Multiple files can be specified, separated by a |
1942 | The separator is | 2053 | .Sq \&: . |
1943 | .Cm \&; | ||
1944 | for MS-Windows, | ||
1945 | .Cm \&, | ||
1946 | for OpenVMS, and | ||
1947 | .Cm \&: | ||
1948 | for all others. | ||
1949 | .It Ar numbits | 2054 | .It Ar numbits |
1950 | This argument specifies that a parameter set should be generated of size | 2055 | This argument specifies that a parameter set should be generated of size |
1951 | .Ar numbits . | 2056 | .Ar numbits . |
1952 | It must be the last option. | 2057 | It must be the last option. |
1953 | If not present, then a value of 512 is used. | 2058 | If not present, then a value of 512 is used. |
1954 | If this value is present then the input file is ignored and | 2059 | If this value is present, then the input file is ignored and |
1955 | parameters are generated instead. | 2060 | parameters are generated instead. |
1956 | .It Fl noout | 2061 | .It Fl noout |
1957 | This option inhibits the output of the encoded version of the parameters. | 2062 | This option inhibits the output of the encoded version of the parameters. |
@@ -1966,7 +2071,7 @@ function. | |||
1966 | Specifying an engine (by it's unique | 2071 | Specifying an engine (by it's unique |
1967 | .Ar id | 2072 | .Ar id |
1968 | string) will cause | 2073 | string) will cause |
1969 | .Nm req | 2074 | .Nm dhparam |
1970 | to attempt to obtain a functional reference to the specified engine, | 2075 | to attempt to obtain a functional reference to the specified engine, |
1971 | thus initialising it if needed. | 2076 | thus initialising it if needed. |
1972 | The engine will then be set as the default for all available algorithms. | 2077 | The engine will then be set as the default for all available algorithms. |
@@ -1992,9 +2097,9 @@ versions of | |||
1992 | .Sh DHPARAM NOTES | 2097 | .Sh DHPARAM NOTES |
1993 | .Ar PEM | 2098 | .Ar PEM |
1994 | format DH parameters use the header and footer lines: | 2099 | format DH parameters use the header and footer lines: |
1995 | .Bd -literal | 2100 | .Bd -unfilled -offset indent |
1996 | \& -----BEGIN DH PARAMETERS----- | 2101 | -----BEGIN DH PARAMETERS----- |
1997 | \& -----END DH PARAMETERS----- | 2102 | -----END DH PARAMETERS----- |
1998 | .Ed | 2103 | .Ed |
1999 | .Pp | 2104 | .Pp |
2000 | .Nm OpenSSL | 2105 | .Nm OpenSSL |
@@ -2021,20 +2126,21 @@ option was added in | |||
2021 | .Sh DSA | 2126 | .Sh DSA |
2022 | .Nm openssl dsa | 2127 | .Nm openssl dsa |
2023 | .Bk -words | 2128 | .Bk -words |
2024 | .Op Fl inform Ar PEM|DER | 2129 | .Op Fl inform Ar DER | PEM |
2025 | .Op Fl outform Ar PEM|DER | 2130 | .Op Fl outform Ar DER | PEM |
2026 | .Op Fl in Ar filename | 2131 | .Op Fl in Ar filename |
2027 | .Op Fl passin Ar arg | 2132 | .Op Fl passin Ar arg |
2028 | .Op Fl out Ar filename | 2133 | .Op Fl out Ar filename |
2029 | .Op Fl passout Ar arg | 2134 | .Op Fl passout Ar arg |
2030 | .Op Fl des | 2135 | .Op Fl pubin |
2031 | .Op Fl des3 | 2136 | .Op Fl pubout |
2032 | .Op Fl idea | 2137 | .Oo |
2138 | .Fl des | des3 | aes128 | aes192 | | ||
2139 | .Fl aes256 | ||
2140 | .Oc | ||
2033 | .Op Fl text | 2141 | .Op Fl text |
2034 | .Op Fl noout | 2142 | .Op Fl noout |
2035 | .Op Fl modulus | 2143 | .Op Fl modulus |
2036 | .Op Fl pubin | ||
2037 | .Op Fl pubout | ||
2038 | .Op Fl engine Ar id | 2144 | .Op Fl engine Ar id |
2039 | .Ek | 2145 | .Ek |
2040 | .Pp | 2146 | .Pp |
@@ -2053,17 +2159,18 @@ command. | |||
2053 | .Pp | 2159 | .Pp |
2054 | The options are as follows: | 2160 | The options are as follows: |
2055 | .Bl -tag -width "XXXX" | 2161 | .Bl -tag -width "XXXX" |
2056 | .It Fl inform Ar DER|PEM | 2162 | .It Fl inform Ar DER | PEM |
2057 | This specifies the input format. | 2163 | This specifies the input format. |
2058 | The | 2164 | The |
2059 | .Ar DER | 2165 | .Ar DER |
2060 | argument with a private key uses an ASN1 DER encoded form of an ASN.1 | 2166 | argument with a private key uses an ASN1 DER encoded form of an ASN.1 |
2061 | SEQUENCE consisting of the values of version (currently zero), p, q, g, | 2167 | SEQUENCE consisting of the values of version |
2062 | the public and private key components respectively as ASN.1 INTEGERs. | 2168 | .Pq currently zero , |
2169 | p, q, g, | ||
2170 | the public and private key components, respectively, as ASN.1 INTEGERs. | ||
2063 | When used with a public key it uses a | 2171 | When used with a public key it uses a |
2064 | .Em SubjectPublicKeyInfo | 2172 | .Em SubjectPublicKeyInfo |
2065 | structure: | 2173 | structure: it is an error if the key is not DSA. |
2066 | It is an error if the key is not DSA. | ||
2067 | .Pp | 2174 | .Pp |
2068 | The | 2175 | The |
2069 | .Ar PEM | 2176 | .Ar PEM |
@@ -2071,19 +2178,19 @@ form is the default format: | |||
2071 | It consists of the DER format base64 | 2178 | It consists of the DER format base64 |
2072 | encoded with additional header and footer lines. | 2179 | encoded with additional header and footer lines. |
2073 | In the case of a private key, PKCS#8 format is also accepted. | 2180 | In the case of a private key, PKCS#8 format is also accepted. |
2074 | .It Fl outform Ar DER|PEM | 2181 | .It Fl outform Ar DER | PEM |
2075 | This specifies the output format, the options have the same meaning as the | 2182 | This specifies the output format; the options have the same meaning as the |
2076 | .Fl inform | 2183 | .Fl inform |
2077 | option. | 2184 | option. |
2078 | .It Fl in Ar filename | 2185 | .It Fl in Ar filename |
2079 | This specifies the input | 2186 | This specifies the input |
2080 | .Ar filename | 2187 | .Ar filename |
2081 | to read a key from or standard input if this option is not specified. | 2188 | to read a key from or standard input if this option is not specified. |
2082 | If the key is encrypted a pass phrase will be prompted for. | 2189 | If the key is encrypted, a pass phrase will be prompted for. |
2083 | .It Fl passin Ar arg | 2190 | .It Fl passin Ar arg |
2084 | The input file password source. | 2191 | The input file password source. |
2085 | For more information about the format of | 2192 | For more information about the format of |
2086 | .Ar arg | 2193 | .Ar arg , |
2087 | see the | 2194 | see the |
2088 | .Sx PASS PHRASE ARGUMENTS | 2195 | .Sx PASS PHRASE ARGUMENTS |
2089 | section above. | 2196 | section above. |
@@ -2099,13 +2206,16 @@ be the same as the input filename. | |||
2099 | .It Fl passout Ar arg | 2206 | .It Fl passout Ar arg |
2100 | The output file password source. | 2207 | The output file password source. |
2101 | For more information about the format of | 2208 | For more information about the format of |
2102 | .Ar arg | 2209 | .Ar arg , |
2103 | see the | 2210 | see the |
2104 | .Sx PASS PHRASE ARGUMENTS | 2211 | .Sx PASS PHRASE ARGUMENTS |
2105 | section above. | 2212 | section above. |
2106 | .It Cm -des|-des3|-idea | 2213 | .It Xo |
2214 | .Fl des | des3 | aes128 | | ||
2215 | .Fl aes192 | aes256 | ||
2216 | .Xc | ||
2107 | These options encrypt the private key with the DES, triple DES, or the | 2217 | These options encrypt the private key with the DES, triple DES, or the |
2108 | IDEA ciphers, respectively, before outputting it. | 2218 | AES ciphers, respectively, before outputting it. |
2109 | A pass phrase is prompted for. | 2219 | A pass phrase is prompted for. |
2110 | If none of these options is specified, the key is written in plain text. | 2220 | If none of these options is specified, the key is written in plain text. |
2111 | This means that using the | 2221 | This means that using the |
@@ -2118,23 +2228,23 @@ These options can only be used with | |||
2118 | .Ar PEM | 2228 | .Ar PEM |
2119 | format output files. | 2229 | format output files. |
2120 | .It Fl text | 2230 | .It Fl text |
2121 | Prints out the public, private key components and parameters. | 2231 | Prints out the public/private key components and parameters. |
2122 | .It Fl noout | 2232 | .It Fl noout |
2123 | This option prevents output of the encoded version of the key. | 2233 | This option prevents output of the encoded version of the key. |
2124 | .It Fl modulus | 2234 | .It Fl modulus |
2125 | This option prints out the value of the public key component of the key. | 2235 | This option prints out the value of the public key component of the key. |
2126 | .It Fl pubin | 2236 | .It Fl pubin |
2127 | By default a private key is read from the input file. | 2237 | By default, a private key is read from the input file. |
2128 | With this option a public key is read instead. | 2238 | With this option a public key is read instead. |
2129 | .It Fl pubout | 2239 | .It Fl pubout |
2130 | By default a private key is output. | 2240 | By default, a private key is output. |
2131 | With this option a public key will be output instead. | 2241 | With this option a public key will be output instead. |
2132 | This option is automatically set if the input is a public key. | 2242 | This option is automatically set if the input is a public key. |
2133 | .It Fl engine Ar id | 2243 | .It Fl engine Ar id |
2134 | Specifying an engine (by it's unique | 2244 | Specifying an engine (by it's unique |
2135 | .Ar id | 2245 | .Ar id |
2136 | string) will cause | 2246 | string) will cause |
2137 | .Nm req | 2247 | .Nm dsa |
2138 | to attempt to obtain a functional reference to the specified engine, | 2248 | to attempt to obtain a functional reference to the specified engine, |
2139 | thus initialising it if needed. | 2249 | thus initialising it if needed. |
2140 | The engine will then be set as the default for all available algorithms. | 2250 | The engine will then be set as the default for all available algorithms. |
@@ -2143,46 +2253,46 @@ The engine will then be set as the default for all available algorithms. | |||
2143 | The | 2253 | The |
2144 | .Ar PEM | 2254 | .Ar PEM |
2145 | private key format uses the header and footer lines: | 2255 | private key format uses the header and footer lines: |
2146 | .Bd -literal | 2256 | .Bd -unfilled -offset indent |
2147 | \& -----BEGIN DSA PRIVATE KEY----- | 2257 | -----BEGIN DSA PRIVATE KEY----- |
2148 | \& -----END DSA PRIVATE KEY----- | 2258 | -----END DSA PRIVATE KEY----- |
2149 | .Ed | 2259 | .Ed |
2150 | .Pp | 2260 | .Pp |
2151 | The | 2261 | The |
2152 | .Ar PEM | 2262 | .Ar PEM |
2153 | public key format uses the header and footer lines: | 2263 | public key format uses the header and footer lines: |
2154 | .Bd -literal | 2264 | .Bd -unfilled -offset indent |
2155 | \& -----BEGIN PUBLIC KEY----- | 2265 | -----BEGIN PUBLIC KEY----- |
2156 | \& -----END PUBLIC KEY----- | 2266 | -----END PUBLIC KEY----- |
2157 | .Ed | 2267 | .Ed |
2158 | .Sh DSA EXAMPLES | 2268 | .Sh DSA EXAMPLES |
2159 | To remove the pass phrase on a DSA private key: | 2269 | To remove the pass phrase on a DSA private key: |
2160 | .Pp | 2270 | .Pp |
2161 | \& $ openssl dsa -in key.pem -out keyout.pem | 2271 | .Dl $ openssl dsa -in key.pem -out keyout.pem |
2162 | .Pp | 2272 | .Pp |
2163 | To encrypt a private key using triple DES: | 2273 | To encrypt a private key using triple DES: |
2164 | .Pp | 2274 | .Pp |
2165 | \& $ openssl dsa -in key.pem -des3 -out keyout.pem | 2275 | .Dl $ openssl dsa -in key.pem -des3 -out keyout.pem |
2166 | .Pp | 2276 | .Pp |
2167 | To convert a private key from PEM to DER format: | 2277 | To convert a private key from PEM to DER format: |
2168 | .Pp | 2278 | .Pp |
2169 | \& $ openssl dsa -in key.pem -outform DER -out keyout.der | 2279 | .Dl $ openssl dsa -in key.pem -outform DER -out keyout.der |
2170 | .Pp | 2280 | .Pp |
2171 | To print out the components of a private key to standard output: | 2281 | To print out the components of a private key to standard output: |
2172 | .Pp | 2282 | .Pp |
2173 | \& $ openssl dsa -in key.pem -text -noout | 2283 | .Dl $ openssl dsa -in key.pem -text -noout |
2174 | .Pp | 2284 | .Pp |
2175 | To just output the public part of a private key: | 2285 | To just output the public part of a private key: |
2176 | .Pp | 2286 | .Pp |
2177 | \& $ openssl dsa -in key.pem -pubout -out pubkey.pem | 2287 | .Dl $ openssl dsa -in key.pem -pubout -out pubkey.pem |
2178 | .\" | 2288 | .\" |
2179 | .\" DSAPARAM | 2289 | .\" DSAPARAM |
2180 | .\" | 2290 | .\" |
2181 | .Sh DSAPARAM | 2291 | .Sh DSAPARAM |
2182 | .Nm openssl dsaparam | 2292 | .Nm openssl dsaparam |
2183 | .Bk -words | 2293 | .Bk -words |
2184 | .Op Fl inform Ar DER|PEM | 2294 | .Op Fl inform Ar DER | PEM |
2185 | .Op Fl outform Ar DER|PEM | 2295 | .Op Fl outform Ar DER | PEM |
2186 | .Op Fl in Ar filename | 2296 | .Op Fl in Ar filename |
2187 | .Op Fl out Ar filename | 2297 | .Op Fl out Ar filename |
2188 | .Op Fl noout | 2298 | .Op Fl noout |
@@ -2196,22 +2306,23 @@ To just output the public part of a private key: | |||
2196 | .Pp | 2306 | .Pp |
2197 | The | 2307 | The |
2198 | .Nm dsaparam | 2308 | .Nm dsaparam |
2199 | command is used to manipulate or generate \s-1DSA\s0 parameter files. | 2309 | command is used to manipulate or generate DSA parameter files. |
2200 | .Pp | 2310 | .Pp |
2201 | The options are as follows: | 2311 | The options are as follows: |
2202 | .Bl -tag -width "XXXX" | 2312 | .Bl -tag -width "XXXX" |
2203 | .It Fl inform Ar DER|PEM | 2313 | .It Fl inform Ar DER | PEM |
2204 | This specifies the input format. | 2314 | This specifies the input format. |
2205 | The | 2315 | The |
2206 | .Ar DER | 2316 | .Ar DER |
2207 | argument uses an ASN1 DER encoded form compatible with RFC 2459 (PKIX) | 2317 | argument uses an ASN1 DER encoded form compatible with RFC 2459 |
2318 | .Pq PKIX | ||
2208 | DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively. | 2319 | DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively. |
2209 | The | 2320 | The |
2210 | .Ar PEM | 2321 | .Ar PEM |
2211 | form is the default format: | 2322 | form is the default format: |
2212 | it consists of the DER format base64 encoded with additional header | 2323 | it consists of the DER format base64 encoded with additional header |
2213 | and footer lines. | 2324 | and footer lines. |
2214 | .It Fl outform Ar DER|PEM | 2325 | .It Fl outform Ar DER | PEM |
2215 | This specifies the output format; the options have the same meaning as the | 2326 | This specifies the output format; the options have the same meaning as the |
2216 | .Fl inform | 2327 | .Fl inform |
2217 | option. | 2328 | option. |
@@ -2221,7 +2332,7 @@ This specifies the input | |||
2221 | to read parameters from, or standard input if this option is not specified. | 2332 | to read parameters from, or standard input if this option is not specified. |
2222 | If the | 2333 | If the |
2223 | .Ar numbits | 2334 | .Ar numbits |
2224 | parameter is included then this option will be ignored. | 2335 | parameter is included, then this option will be ignored. |
2225 | .It Fl out Ar filename | 2336 | .It Fl out Ar filename |
2226 | This specifies the output | 2337 | This specifies the output |
2227 | .Ar filename | 2338 | .Ar filename |
@@ -2243,31 +2354,23 @@ function. | |||
2243 | This option will generate a DSA either using the specified or generated | 2354 | This option will generate a DSA either using the specified or generated |
2244 | parameters. | 2355 | parameters. |
2245 | .It Fl rand Ar file ... | 2356 | .It Fl rand Ar file ... |
2246 | A | 2357 | A file or files containing random data used to seed the random number |
2247 | .Ar file | ||
2248 | or | ||
2249 | .Ar file Ns Li s | ||
2250 | containing random data used to seed the random number | ||
2251 | generator, or an EGD socket (see | 2358 | generator, or an EGD socket (see |
2252 | .Xr RAND_egd 3 ) . | 2359 | .Xr RAND_egd 3 ) . |
2253 | Multiple files can be specified, separated by an OS-dependent character. | 2360 | Multiple files can be specified, separated by a |
2254 | The separator is | 2361 | .Sq \&: . |
2255 | .Cm \&; | ||
2256 | for MS-Windows, | ||
2257 | .Cm \&, | ||
2258 | for OpenVMS, and | ||
2259 | .Cm \&: | ||
2260 | for all others. | ||
2261 | .It Ar numbits | 2362 | .It Ar numbits |
2262 | This option specifies that a parameter set should be generated of size | 2363 | This option specifies that a parameter set should be generated of size |
2263 | .Ar numbits . | 2364 | .Ar numbits . |
2264 | It must be the last option. | 2365 | It must be the last option. |
2265 | If this option is included, then the input file (if any) is ignored. | 2366 | If this option is included, then the input file |
2367 | .Pq if any | ||
2368 | is ignored. | ||
2266 | .It Fl engine Ar id | 2369 | .It Fl engine Ar id |
2267 | Specifying an engine (by it's unique | 2370 | Specifying an engine (by it's unique |
2268 | .Ar id | 2371 | .Ar id |
2269 | string) will cause | 2372 | string) will cause |
2270 | .Nm req | 2373 | .Nm dsaparam |
2271 | to attempt to obtain a functional reference to the specified engine, | 2374 | to attempt to obtain a functional reference to the specified engine, |
2272 | thus initialising it if needed. | 2375 | thus initialising it if needed. |
2273 | The engine will then be set as the default for all available algorithms. | 2376 | The engine will then be set as the default for all available algorithms. |
@@ -2275,9 +2378,9 @@ The engine will then be set as the default for all available algorithms. | |||
2275 | .Sh DSAPARAM NOTES | 2378 | .Sh DSAPARAM NOTES |
2276 | .Ar PEM | 2379 | .Ar PEM |
2277 | format DSA parameters use the header and footer lines: | 2380 | format DSA parameters use the header and footer lines: |
2278 | .Bd -literal | 2381 | .Bd -unfilled -offset indent |
2279 | \& -----BEGIN DSA PARAMETERS----- | 2382 | -----BEGIN DSA PARAMETERS----- |
2280 | \& -----END DSA PARAMETERS----- | 2383 | -----END DSA PARAMETERS----- |
2281 | .Ed | 2384 | .Ed |
2282 | .Pp | 2385 | .Pp |
2283 | DSA parameter generation is a slow process and as a result the same set of | 2386 | DSA parameter generation is a slow process and as a result the same set of |
@@ -2287,16 +2390,20 @@ DSA parameters is often used to generate several distinct keys. | |||
2287 | .\" | 2390 | .\" |
2288 | .Sh ENC | 2391 | .Sh ENC |
2289 | .Nm openssl enc | 2392 | .Nm openssl enc |
2393 | .Bk -words | ||
2290 | .Fl ciphername | 2394 | .Fl ciphername |
2291 | .Op Fl in Ar filename | 2395 | .Op Fl in Ar filename |
2292 | .Op Fl out Ar filename | 2396 | .Op Fl out Ar filename |
2293 | .Op Fl pass Ar arg | 2397 | .Op Fl pass Ar arg |
2398 | .Op Fl salt | ||
2399 | .Op Fl nosalt | ||
2294 | .Op Fl e | 2400 | .Op Fl e |
2295 | .Op Fl d | 2401 | .Op Fl d |
2296 | .Op Fl a | 2402 | .Op Fl a |
2297 | .Op Fl A | 2403 | .Op Fl A |
2298 | .Op Fl k Ar password | 2404 | .Op Fl k Ar password |
2299 | .Op Fl kfile Ar filename | 2405 | .Op Fl kfile Ar filename |
2406 | .Op Fl S Ar salt | ||
2300 | .Op Fl K Ar key | 2407 | .Op Fl K Ar key |
2301 | .Op Fl iv Ar IV | 2408 | .Op Fl iv Ar IV |
2302 | .Op Fl p | 2409 | .Op Fl p |
@@ -2304,11 +2411,14 @@ DSA parameters is often used to generate several distinct keys. | |||
2304 | .Op Fl bufsize Ar number | 2411 | .Op Fl bufsize Ar number |
2305 | .Op Fl nopad | 2412 | .Op Fl nopad |
2306 | .Op Fl debug | 2413 | .Op Fl debug |
2414 | .Op Fl engine Ar id | ||
2415 | .Ek | ||
2307 | .Pp | 2416 | .Pp |
2308 | The symmetric cipher commands allow data to be encrypted or decrypted | 2417 | The symmetric cipher commands allow data to be encrypted or decrypted |
2309 | using various block and stream ciphers using keys based on passwords | 2418 | using various block and stream ciphers using keys based on passwords |
2310 | or explicitly provided. Base64 encoding or decoding can also be performed | 2419 | or explicitly provided. |
2311 | either by itself or in addition to the encryption or decryption. | 2420 | Base64 encoding or decoding can also be performed either by itself |
2421 | or in addition to the encryption or decryption. | ||
2312 | .Pp | 2422 | .Pp |
2313 | The options are as follows: | 2423 | The options are as follows: |
2314 | .Bl -tag -width "XXXX" | 2424 | .Bl -tag -width "XXXX" |
@@ -2323,7 +2433,7 @@ standard output by default. | |||
2323 | .It Fl pass Ar arg | 2433 | .It Fl pass Ar arg |
2324 | The password source. | 2434 | The password source. |
2325 | For more information about the format of | 2435 | For more information about the format of |
2326 | .Ar arg | 2436 | .Ar arg , |
2327 | see the | 2437 | see the |
2328 | .Sx PASS PHRASE ARGUMENTS | 2438 | .Sx PASS PHRASE ARGUMENTS |
2329 | section above. | 2439 | section above. |
@@ -2443,6 +2553,14 @@ Set the buffer size for I/O. | |||
2443 | Disable standard block padding. | 2553 | Disable standard block padding. |
2444 | .It Fl debug | 2554 | .It Fl debug |
2445 | Debug the BIOs used for I/O. | 2555 | Debug the BIOs used for I/O. |
2556 | .It Fl engine Ar id | ||
2557 | Specifying an engine (by it's unique | ||
2558 | .Ar id | ||
2559 | string) will cause | ||
2560 | .Nm enc | ||
2561 | to attempt to obtain a functional reference to the specified engine, | ||
2562 | thus initialising it if needed. | ||
2563 | The engine will then be set as the default for all available algorithms. | ||
2446 | .El | 2564 | .El |
2447 | .Sh ENC NOTES | 2565 | .Sh ENC NOTES |
2448 | The program can be called either as | 2566 | The program can be called either as |
@@ -2493,111 +2611,109 @@ this allows a rudimentary integrity or password check to be performed. | |||
2493 | However, since the chance of random data passing the test is | 2611 | However, since the chance of random data passing the test is |
2494 | better than 1 in 256, it isn't a very good test. | 2612 | better than 1 in 256, it isn't a very good test. |
2495 | .Pp | 2613 | .Pp |
2496 | If padding is disabled then the input data must be a multiple of the cipher | 2614 | If padding is disabled, then the input data must be a multiple of the cipher |
2497 | block length. | 2615 | block length. |
2498 | .Pp | 2616 | .Pp |
2499 | All RC2 ciphers have the same key and effective key length. | 2617 | All RC2 ciphers have the same key and effective key length. |
2500 | .Pp | 2618 | .Pp |
2501 | Blowfish and RC5 algorithms use a 128 bit key. | 2619 | Blowfish and RC5 algorithms use a 128-bit key. |
2502 | .Sh ENC SUPPORTED CIPHERS | 2620 | .Sh ENC SUPPORTED CIPHERS |
2503 | .Bd -literal | 2621 | .Bd -unfilled -offset indent |
2504 | \& base64 Base 64 | 2622 | aes-128-cbc 128-bit AES in CBC mode |
2505 | .Ed | 2623 | aes128 Alias for aes-128-cbc |
2506 | .Bd -literal | 2624 | aes-128-cfb 128-bit AES in CFB mode |
2507 | \& bf-cbc Blowfish in CBC mode | 2625 | aes-128-ecb 128-bit AES in ECB mode |
2508 | \& bf Alias for bf-cbc | 2626 | aes-128-ofb 128-bit AES in OFB mode |
2509 | \& bf-cfb Blowfish in CFB mode | 2627 | |
2510 | \& bf-ecb Blowfish in ECB mode | 2628 | aes-192-cbc 192-bit AES in CBC mode |
2511 | \& bf-ofb Blowfish in OFB mode | 2629 | aes192 Alias for aes-192-cbc |
2512 | .Ed | 2630 | aes-192-cfb 192-bit AES in CFB mode |
2513 | .Bd -literal | 2631 | aes-192-ecb 192-bit AES in ECB mode |
2514 | \& cast-cbc CAST in CBC mode | 2632 | aes-192-ofb 192-bit AES in OFB mode |
2515 | \& cast Alias for cast-cbc | 2633 | |
2516 | \& cast5-cbc CAST5 in CBC mode | 2634 | aes-256-cbc 256-bit AES in CBC mode |
2517 | \& cast5-cfb CAST5 in CFB mode | 2635 | aes256 Alias for aes-256-cbc |
2518 | \& cast5-ecb CAST5 in ECB mode | 2636 | aes-256-cfb 256-bit AES in CFB mode |
2519 | \& cast5-ofb CAST5 in OFB mode | 2637 | aes-256-ecb 256-bit AES in ECB mode |
2520 | .Ed | 2638 | aes-256-ofb 256-bit AES in OFB mode |
2521 | .Bd -literal | 2639 | |
2522 | \& des-cbc DES in CBC mode | 2640 | base64 Base 64 |
2523 | \& des Alias for des-cbc | 2641 | |
2524 | \& des-cfb DES in CBC mode | 2642 | bf-cbc Blowfish in CBC mode |
2525 | \& des-ofb DES in OFB mode | 2643 | bf Alias for bf-cbc |
2526 | \& des-ecb DES in ECB mode | 2644 | blowfish Alias for bf-cbc |
2527 | .Ed | 2645 | bf-cfb Blowfish in CFB mode |
2528 | .Bd -literal | 2646 | bf-ecb Blowfish in ECB mode |
2529 | \& des-ede-cbc Two key triple DES EDE in CBC mode | 2647 | bf-ofb Blowfish in OFB mode |
2530 | \& des-ede Alias for des-ede | 2648 | |
2531 | \& des-ede-cfb Two key triple DES EDE in CFB mode | 2649 | cast-cbc CAST in CBC mode |
2532 | \& des-ede-ofb Two key triple DES EDE in OFB mode | 2650 | cast Alias for cast-cbc |
2533 | .Ed | 2651 | cast5-cbc CAST5 in CBC mode |
2534 | .Bd -literal | 2652 | cast5-cfb CAST5 in CFB mode |
2535 | \& des-ede3-cbc Three key triple DES EDE in CBC mode | 2653 | cast5-ecb CAST5 in ECB mode |
2536 | \& des-ede3 Alias for des-ede3-cbc | 2654 | cast5-ofb CAST5 in OFB mode |
2537 | \& des3 Alias for des-ede3-cbc | 2655 | |
2538 | \& des-ede3-cfb Three key triple DES EDE CFB mode | 2656 | des-cbc DES in CBC mode |
2539 | \& des-ede3-ofb Three key triple DES EDE in OFB mode | 2657 | des Alias for des-cbc |
2540 | .Ed | 2658 | des-cfb DES in CBC mode |
2541 | .Bd -literal | 2659 | des-ofb DES in OFB mode |
2542 | \& desx DESX algorithm. | 2660 | des-ecb DES in ECB mode |
2543 | .Ed | 2661 | |
2544 | .Bd -literal | 2662 | des-ede-cbc Two key triple DES EDE in CBC mode |
2545 | \& idea-cbc IDEA algorithm in CBC mode | 2663 | des-ede Alias for des-ede |
2546 | \& idea same as idea-cbc | 2664 | des-ede-cfb Two key triple DES EDE in CFB mode |
2547 | \& idea-cfb IDEA in CFB mode | 2665 | des-ede-ofb Two key triple DES EDE in OFB mode |
2548 | \& idea-ecb IDEA in ECB mode | 2666 | |
2549 | \& idea-ofb IDEA in OFB mode | 2667 | des-ede3-cbc Three key triple DES EDE in CBC mode |
2550 | .Ed | 2668 | des-ede3 Alias for des-ede3-cbc |
2551 | .Bd -literal | 2669 | des3 Alias for des-ede3-cbc |
2552 | \& rc2-cbc 128 bit RC2 in CBC mode | 2670 | des-ede3-cfb Three key triple DES EDE CFB mode |
2553 | \& rc2 Alias for rc2-cbc | 2671 | des-ede3-ofb Three key triple DES EDE in OFB mode |
2554 | \& rc2-cfb 128 bit RC2 in CBC mode | 2672 | |
2555 | \& rc2-ecb 128 bit RC2 in CBC mode | 2673 | desx-cbc DESX algorithm |
2556 | \& rc2-ofb 128 bit RC2 in CBC mode | 2674 | desx Alias for desx-cbc |
2557 | \& rc2-64-cbc 64 bit RC2 in CBC mode | 2675 | |
2558 | \& rc2-40-cbc 40 bit RC2 in CBC mode | 2676 | rc2-cbc 128-bit RC2 in CBC mode |
2559 | .Ed | 2677 | rc2 Alias for rc2-cbc |
2560 | .Bd -literal | 2678 | rc2-cfb 128-bit RC2 in CBC mode |
2561 | \& rc4 128 bit RC4 | 2679 | rc2-ecb 128-bit RC2 in CBC mode |
2562 | \& rc4-64 64 bit RC4 | 2680 | rc2-ofb 128-bit RC2 in CBC mode |
2563 | \& rc4-40 40 bit RC4 | 2681 | rc2-64-cbc 64-bit RC2 in CBC mode |
2564 | .Ed | 2682 | rc2-40-cbc 40-bit RC2 in CBC mode |
2565 | .Bd -literal | 2683 | |
2566 | \& rc5-cbc RC5 cipher in CBC mode | 2684 | rc4 128-bit RC4 |
2567 | \& rc5 Alias for rc5-cbc | 2685 | rc4-40 40-bit RC4 |
2568 | \& rc5-cfb RC5 cipher in CBC mode | ||
2569 | \& rc5-ecb RC5 cipher in CBC mode | ||
2570 | \& rc5-ofb RC5 cipher in CBC mode | ||
2571 | .Ed | 2686 | .Ed |
2572 | .Sh ENC EXAMPLES | 2687 | .Sh ENC EXAMPLES |
2573 | Just base64 encode a binary file: | 2688 | Just base64 encode a binary file: |
2574 | .Pp | 2689 | .Pp |
2575 | \& $ openssl base64 -in file.bin -out file.b64 | 2690 | .Dl $ openssl base64 -in file.bin -out file.b64 |
2576 | .Pp | 2691 | .Pp |
2577 | Decode the same file: | 2692 | Decode the same file: |
2578 | .Pp | 2693 | .Pp |
2579 | \& $ openssl base64 -d -in file.b64 -out file.bin | 2694 | .Dl $ openssl base64 -d -in file.b64 -out file.bin |
2580 | .Pp | 2695 | .Pp |
2581 | Encrypt a file using triple DES in CBC mode using a prompted password: | 2696 | Encrypt a file using triple DES in CBC mode using a prompted password: |
2582 | .Pp | 2697 | .Pp |
2583 | \& $ openssl des3 -salt -in file.txt -out file.des3 | 2698 | .Dl $ openssl des3 -salt -in file.txt -out file.des3 |
2584 | .Pp | 2699 | .Pp |
2585 | Decrypt a file using a supplied password: | 2700 | Decrypt a file using a supplied password: |
2586 | .Pp | 2701 | .Pp |
2587 | \& $ openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword | 2702 | .Dl "$ openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword" |
2588 | .Pp | 2703 | .Pp |
2589 | Encrypt a file then base64 encode it (so it can be sent via mail for example) | 2704 | Encrypt a file then base64 encode it |
2705 | (so it can be sent via mail for example) | ||
2590 | using Blowfish in CBC mode: | 2706 | using Blowfish in CBC mode: |
2591 | .Pp | 2707 | .Pp |
2592 | \& $ openssl bf -a -salt -in file.txt -out file.bf | 2708 | .Dl $ openssl bf -a -salt -in file.txt -out file.bf |
2593 | .Pp | 2709 | .Pp |
2594 | Base64 decode a file then decrypt it: | 2710 | Base64 decode a file then decrypt it: |
2595 | .Pp | 2711 | .Pp |
2596 | \& $ openssl bf -d -salt -a -in file.bf -out file.txt | 2712 | .Dl "$ openssl bf -d -salt -a -in file.bf -out file.txt" |
2597 | .Pp | 2713 | .Pp |
2598 | Decrypt some data using a supplied 40 bit RC4 key: | 2714 | Decrypt some data using a supplied 40-bit RC4 key: |
2599 | .Pp | 2715 | .Pp |
2600 | \& $ openssl rc4-40 -in file.rc4 -out file.txt -K 0102030405 | 2716 | .Dl $ openssl rc4-40 -in file.rc4 -out file.txt -K 0102030405 |
2601 | .Sh ENC BUGS | 2717 | .Sh ENC BUGS |
2602 | The | 2718 | The |
2603 | .Fl A | 2719 | .Fl A |
@@ -2616,12 +2732,13 @@ or RC4 with an 84-bit key with this program. | |||
2616 | .Sh ERRSTR | 2732 | .Sh ERRSTR |
2617 | The | 2733 | The |
2618 | .Nm errstr | 2734 | .Nm errstr |
2619 | utility is undocumented. | 2735 | utility is currently undocumented. |
2620 | .\" | 2736 | .\" |
2621 | .\" GENDH | 2737 | .\" GENDH |
2622 | .\" | 2738 | .\" |
2623 | .Sh GENDH | 2739 | .Sh GENDH |
2624 | Generation of Diffie-Hellman Parameters. Replaced by | 2740 | Generation of Diffie-Hellman Parameters. |
2741 | Replaced by | ||
2625 | .Nm dhparam . | 2742 | .Nm dhparam . |
2626 | See | 2743 | See |
2627 | .Sx DHPARAM | 2744 | .Sx DHPARAM |
@@ -2631,49 +2748,45 @@ above. | |||
2631 | .\" | 2748 | .\" |
2632 | .Sh GENDSA | 2749 | .Sh GENDSA |
2633 | .Nm openssl gendsa | 2750 | .Nm openssl gendsa |
2751 | .Bk -words | ||
2634 | .Op Fl out Ar filename | 2752 | .Op Fl out Ar filename |
2635 | .Op Fl des | ||
2636 | .Op Fl des3 | ||
2637 | .Op Fl idea | ||
2638 | .Op Fl rand Ar file ... | 2753 | .Op Fl rand Ar file ... |
2639 | .Op Fl engine Ar id | 2754 | .Op Fl engine Ar id |
2755 | .Oo | ||
2756 | .Fl des | des3 | aes128 | | ||
2757 | .Fl aes192 | aes256 | ||
2758 | .Oc | ||
2640 | .Op Ar paramfile | 2759 | .Op Ar paramfile |
2760 | .Ek | ||
2641 | .Pp | 2761 | .Pp |
2642 | The | 2762 | The |
2643 | .Nm gendsa | 2763 | .Nm gendsa |
2644 | command generates a DSA private key from a DSA parameter file | 2764 | command generates a DSA private key from a DSA parameter file |
2645 | (which will be typically generated by the | 2765 | (which will typically be generated by the |
2646 | .Nm openssl dsaparam | 2766 | .Nm openssl dsaparam |
2647 | command). | 2767 | command). |
2648 | .Pp | 2768 | .Pp |
2649 | The options are as follows: | 2769 | The options are as follows: |
2650 | .Bl -tag -width "XXXX" | 2770 | .Bl -tag -width "XXXX" |
2651 | .It Cm -des|-des3|-idea | 2771 | .It Xo |
2772 | .Fl des | des3 | aes128 | | ||
2773 | .Fl aes192 | aes256 | ||
2774 | .Xc | ||
2652 | These options encrypt the private key with the DES, triple DES, | 2775 | These options encrypt the private key with the DES, triple DES, |
2653 | or the IDEA ciphers, respectively, before outputting it. | 2776 | or the AES ciphers, respectively, before outputting it. |
2654 | A pass phrase is prompted for. | 2777 | A pass phrase is prompted for. |
2655 | If none of these options is specified, no encryption is used. | 2778 | If none of these options is specified, no encryption is used. |
2656 | .It Fl rand Ar file ... | 2779 | .It Fl rand Ar file ... |
2657 | A | 2780 | A file or files containing random data used to seed the random number |
2658 | .Ar file | ||
2659 | or | ||
2660 | .Ar file Ns Li s | ||
2661 | containing random data used to seed the random number | ||
2662 | generator, or an EGD socket (see | 2781 | generator, or an EGD socket (see |
2663 | .Xr RAND_egd 3 ) . | 2782 | .Xr RAND_egd 3 ) . |
2664 | Multiple files can be specified separated by an OS-dependent character. | 2783 | Multiple files can be specified separated by a |
2665 | The separator is | 2784 | .Sq \&: . |
2666 | .Cm \&; | ||
2667 | for MS-Windows, | ||
2668 | .Cm \&, | ||
2669 | for OpenVMS, and | ||
2670 | .Cm \&: | ||
2671 | for all others. | ||
2672 | .It Fl engine Ar id | 2785 | .It Fl engine Ar id |
2673 | Specifying an engine (by it's unique | 2786 | Specifying an engine (by it's unique |
2674 | .Ar id | 2787 | .Ar id |
2675 | string) will cause | 2788 | string) will cause |
2676 | .Nm req | 2789 | .Nm gendsa |
2677 | to attempt to obtain a functional reference to the specified engine, | 2790 | to attempt to obtain a functional reference to the specified engine, |
2678 | thus initialising it if needed. | 2791 | thus initialising it if needed. |
2679 | The engine will then be set as the default for all available algorithms. | 2792 | The engine will then be set as the default for all available algorithms. |
@@ -2692,16 +2805,18 @@ much quicker that RSA key generation for example. | |||
2692 | .\" | 2805 | .\" |
2693 | .Sh GENRSA | 2806 | .Sh GENRSA |
2694 | .Nm openssl genrsa | 2807 | .Nm openssl genrsa |
2808 | .Bk -words | ||
2809 | .Oo | ||
2810 | .Fl des | des3 | aes128 | | ||
2811 | .Fl aes192 | aes256 | ||
2812 | .Oc | ||
2695 | .Op Fl out Ar filename | 2813 | .Op Fl out Ar filename |
2696 | .Op Fl passout Ar arg | 2814 | .Op Fl passout Ar arg |
2697 | .Op Fl des | 2815 | .Op Fl f4 | 3 |
2698 | .Op Fl des3 | ||
2699 | .Op Fl idea | ||
2700 | .Op Fl f4 | ||
2701 | .Op Fl 3 | ||
2702 | .Op Fl rand Ar file ... | 2816 | .Op Fl rand Ar file ... |
2703 | .Op Fl engine Ar id | 2817 | .Op Fl engine Ar id |
2704 | .Op Ar numbits | 2818 | .Op Ar numbits |
2819 | .Ek | ||
2705 | .Pp | 2820 | .Pp |
2706 | The | 2821 | The |
2707 | .Nm genrsa | 2822 | .Nm genrsa |
@@ -2716,42 +2831,36 @@ If this argument is not specified then standard output is used. | |||
2716 | .It Fl passout Ar arg | 2831 | .It Fl passout Ar arg |
2717 | The output file password source. | 2832 | The output file password source. |
2718 | For more information about the format of | 2833 | For more information about the format of |
2719 | .Ar arg | 2834 | .Ar arg , |
2720 | see the | 2835 | see the |
2721 | .Sx PASS PHRASE ARGUMENTS | 2836 | .Sx PASS PHRASE ARGUMENTS |
2722 | section above. | 2837 | section above. |
2723 | .It Cm -des|-des3|-idea | 2838 | .It Xo |
2839 | .Fl des | des3 | aes128 | | ||
2840 | .Fl aes192 | aes256 | ||
2841 | .Xc | ||
2724 | These options encrypt the private key with the DES, triple DES, or the | 2842 | These options encrypt the private key with the DES, triple DES, or the |
2725 | IDEA ciphers, respectively, before outputting it. | 2843 | AES ciphers, respectively, before outputting it. |
2726 | If none of these options is specified, no encryption is used. | 2844 | If none of these options is specified, no encryption is used. |
2727 | If encryption is used a pass phrase is prompted for, | 2845 | If encryption is used a pass phrase is prompted for, |
2728 | if it is not supplied via the | 2846 | if it is not supplied via the |
2729 | .Fl passout | 2847 | .Fl passout |
2730 | option. | 2848 | option. |
2731 | .It Cm -F4|-3 | 2849 | .It Fl F4 | 3 |
2732 | The public exponent to use, either 65537 or 3. | 2850 | The public exponent to use, either 65537 or 3. |
2733 | The default is 65537. | 2851 | The default is 65537. |
2734 | .It Fl rand Ar file ... | 2852 | .It Fl rand Ar file ... |
2735 | A | 2853 | A file or files |
2736 | .Ar file | ||
2737 | or | ||
2738 | .Ar file Ns Li s | ||
2739 | containing random data used to seed the random number | 2854 | containing random data used to seed the random number |
2740 | generator, or an EGD socket (see | 2855 | generator, or an EGD socket (see |
2741 | .Xr RAND_egd 3 ) . | 2856 | .Xr RAND_egd 3 ) . |
2742 | Multiple files can be specified separated by an OS-dependent character. | 2857 | Multiple files can be specified separated by a |
2743 | The separator is | 2858 | .Sq \&: . |
2744 | .Cm \&; | ||
2745 | for MS-Windows, | ||
2746 | .Cm \&, | ||
2747 | for OpenVMS, and | ||
2748 | .Cm \&: | ||
2749 | for all others. | ||
2750 | .It Fl engine Ar id | 2859 | .It Fl engine Ar id |
2751 | Specifying an engine (by it's unique | 2860 | Specifying an engine (by it's unique |
2752 | .Ar id | 2861 | .Ar id |
2753 | string) will cause | 2862 | string) will cause |
2754 | .Nm req | 2863 | .Nm genrsa |
2755 | to attempt to obtain a functional reference to the specified engine, | 2864 | to attempt to obtain a functional reference to the specified engine, |
2756 | thus initialising it if needed. | 2865 | thus initialising it if needed. |
2757 | The engine will then be set as the default for all available algorithms. | 2866 | The engine will then be set as the default for all available algorithms. |
@@ -2766,12 +2875,12 @@ numbers. | |||
2766 | When generating a private key, various symbols will be output to | 2875 | When generating a private key, various symbols will be output to |
2767 | indicate the progress of the generation. | 2876 | indicate the progress of the generation. |
2768 | A | 2877 | A |
2769 | .Em \&. | 2878 | .Sq \&. |
2770 | represents each number which has passed an initial sieve test, | 2879 | represents each number which has passed an initial sieve test; |
2771 | .Em \&+ | 2880 | .Sq + |
2772 | means a number has passed a single round of the Miller-Rabin primality test. | 2881 | means a number has passed a single round of the Miller-Rabin primality test. |
2773 | A newline means that the number has passed all the prime tests | 2882 | A newline means that the number has passed all the prime tests |
2774 | (the actual number depends on the key size). | 2883 | .Pq the actual number depends on the key size . |
2775 | .Pp | 2884 | .Pp |
2776 | Because key generation is a random process the time taken to generate a key | 2885 | Because key generation is a random process the time taken to generate a key |
2777 | may vary somewhat. | 2886 | may vary somewhat. |
@@ -2780,7 +2889,8 @@ A quirk of the prime generation algorithm is that it cannot generate small | |||
2780 | primes. | 2889 | primes. |
2781 | Therefore the number of bits should not be less that 64. | 2890 | Therefore the number of bits should not be less that 64. |
2782 | For typical private keys this will not matter because for security reasons | 2891 | For typical private keys this will not matter because for security reasons |
2783 | they will be much larger (typically 1024 bits). | 2892 | they will be much larger |
2893 | .Pq typically 1024 bits . | ||
2784 | .\" | 2894 | .\" |
2785 | .\" NSEQ | 2895 | .\" NSEQ |
2786 | .\" | 2896 | .\" |
@@ -2808,7 +2918,7 @@ Specifies the output | |||
2808 | .Ar filename | 2918 | .Ar filename |
2809 | or standard output by default. | 2919 | or standard output by default. |
2810 | .It Fl toseq | 2920 | .It Fl toseq |
2811 | Normally a Netscape certificate sequence will be input and the output | 2921 | Normally, a Netscape certificate sequence will be input and the output |
2812 | is the certificates contained in it. | 2922 | is the certificates contained in it. |
2813 | With the | 2923 | With the |
2814 | .Fl toseq | 2924 | .Fl toseq |
@@ -2818,20 +2928,20 @@ a Netscape certificate sequence is created from a file of certificates. | |||
2818 | .Sh NSEQ EXAMPLES | 2928 | .Sh NSEQ EXAMPLES |
2819 | Output the certificates in a Netscape certificate sequence: | 2929 | Output the certificates in a Netscape certificate sequence: |
2820 | .Bd -literal | 2930 | .Bd -literal |
2821 | \& $ openssl nseq -in nseq.pem -out certs.pem | 2931 | .Dl $ openssl nseq -in nseq.pem -out certs.pem |
2822 | .Ed | 2932 | .Ed |
2823 | .Pp | 2933 | .Pp |
2824 | Create a Netscape certificate sequence: | 2934 | Create a Netscape certificate sequence: |
2825 | .Bd -literal | 2935 | .Bd -literal |
2826 | \& $ openssl nseq -in certs.pem -toseq -out nseq.pem | 2936 | .Dl $ openssl nseq -in certs.pem -toseq -out nseq.pem |
2827 | .Ed | 2937 | .Ed |
2828 | .Sh NSEQ NOTES | 2938 | .Sh NSEQ NOTES |
2829 | The | 2939 | The |
2830 | .Em PEM | 2940 | .Em PEM |
2831 | encoded form uses the same headers and footers as a certificate: | 2941 | encoded form uses the same headers and footers as a certificate: |
2832 | .Bd -literal | 2942 | .Bd -unfilled -offset indent |
2833 | \& -----BEGIN CERTIFICATE----- | 2943 | -----BEGIN CERTIFICATE----- |
2834 | \& -----END CERTIFICATE----- | 2944 | -----END CERTIFICATE----- |
2835 | .Ed | 2945 | .Ed |
2836 | .Pp | 2946 | .Pp |
2837 | A Netscape certificate sequence is a Netscape specific form that can be sent | 2947 | A Netscape certificate sequence is a Netscape specific form that can be sent |
@@ -2870,7 +2980,10 @@ input and output files and allowing multiple certificate files to be used. | |||
2870 | .Op Fl nonce | 2980 | .Op Fl nonce |
2871 | .Op Fl no_nonce | 2981 | .Op Fl no_nonce |
2872 | .Op Fl url Ar URL | 2982 | .Op Fl url Ar URL |
2873 | .Op Fl host Ar host:n | 2983 | .Oo |
2984 | .Fl host | ||
2985 | .Ar hostname Ns : Ns Ar port | ||
2986 | .Oc | ||
2874 | .Op Fl path | 2987 | .Op Fl path |
2875 | .Op Fl CApath Ar dir | 2988 | .Op Fl CApath Ar dir |
2876 | .Op Fl CAfile Ar file | 2989 | .Op Fl CAfile Ar file |
@@ -2898,15 +3011,19 @@ input and output files and allowing multiple certificate files to be used. | |||
2898 | .Op Fl nrequest Ar n | 3011 | .Op Fl nrequest Ar n |
2899 | .Ek | 3012 | .Ek |
2900 | .Pp | 3013 | .Pp |
2901 | The Online Certificate Status Protocol (OCSP) enables applications to | 3014 | The Online Certificate Status Protocol |
2902 | determine the (revocation) state of an identified certificate (RFC 2560). | 3015 | .Pq OCSP |
3016 | enables applications to determine the | ||
3017 | .Pq revocation | ||
3018 | state of an identified certificate | ||
3019 | .Pq RFC 2560 . | ||
2903 | .Pp | 3020 | .Pp |
2904 | The | 3021 | The |
2905 | .Nm ocsp | 3022 | .Nm ocsp |
2906 | command performs many common OCSP tasks. | 3023 | command performs many common OCSP tasks. |
2907 | It can be used to print out requests and responses, | 3024 | It can be used to print out requests and responses, |
2908 | create requests and send queries to an OCSP responder and behave like | 3025 | create requests and send queries to an OCSP responder, |
2909 | a mini OCSP server itself. | 3026 | and behave like a mini OCSP server itself. |
2910 | .Pp | 3027 | .Pp |
2911 | The options are as follows: | 3028 | The options are as follows: |
2912 | .Bl -tag -width "XXXX" | 3029 | .Bl -tag -width "XXXX" |
@@ -2936,8 +3053,10 @@ option except the certificate with serial number | |||
2936 | .Ar num | 3053 | .Ar num |
2937 | is added to the request. | 3054 | is added to the request. |
2938 | The serial number is interpreted as a decimal integer unless preceded by | 3055 | The serial number is interpreted as a decimal integer unless preceded by |
2939 | .Em 0x . | 3056 | .Sq 0x . |
2940 | Negative integers can also be specified by preceding the value by a `-' sign. | 3057 | Negative integers can also be specified by preceding the value with a |
3058 | .Sq - | ||
3059 | sign. | ||
2941 | .It Fl signer Ar filename , Fl signkey Ar filename | 3060 | .It Fl signer Ar filename , Fl signkey Ar filename |
2942 | Sign the OCSP request using the certificate specified in the | 3061 | Sign the OCSP request using the certificate specified in the |
2943 | .Fl signer | 3062 | .Fl signer |
@@ -2946,9 +3065,9 @@ option and the private key specified by the | |||
2946 | option. | 3065 | option. |
2947 | If the | 3066 | If the |
2948 | .Fl signkey | 3067 | .Fl signkey |
2949 | option is not present then the private key is read from the same file | 3068 | option is not present, then the private key is read from the same file |
2950 | as the certificate. | 3069 | as the certificate. |
2951 | If neither option is specified then the OCSP request is not signed. | 3070 | If neither option is specified, then the OCSP request is not signed. |
2952 | .It Fl sign_other Ar filename | 3071 | .It Fl sign_other Ar filename |
2953 | Additional certificates to include in the signed request. | 3072 | Additional certificates to include in the signed request. |
2954 | .It Fl nonce , no_nonce | 3073 | .It Fl nonce , no_nonce |
@@ -2977,7 +3096,7 @@ is automatically added; specifying | |||
2977 | .Fl no_nonce | 3096 | .Fl no_nonce |
2978 | overrides this. | 3097 | overrides this. |
2979 | .It Fl req_text , resp_text , text | 3098 | .It Fl req_text , resp_text , text |
2980 | Print out the text form of the OCSP request, response or both, respectively. | 3099 | Print out the text form of the OCSP request, response, or both, respectively. |
2981 | .It Fl reqout Ar file , Fl respout Ar file | 3100 | .It Fl reqout Ar file , Fl respout Ar file |
2982 | Write out the DER encoded certificate request or response to | 3101 | Write out the DER encoded certificate request or response to |
2983 | .Ar file . | 3102 | .Ar file . |
@@ -2993,8 +3112,13 @@ and | |||
2993 | options). | 3112 | options). |
2994 | .It Fl url Ar responder_url | 3113 | .It Fl url Ar responder_url |
2995 | Specify the responder URL. | 3114 | Specify the responder URL. |
2996 | Both HTTP and HTTPS (SSL/TLS) URLs can be specified. | 3115 | Both HTTP and HTTPS |
2997 | .It Fl host Ar hostname:port , Fl path Ar pathname | 3116 | .Pq SSL/TLS |
3117 | URLs can be specified. | ||
3118 | .It Xo | ||
3119 | .Fl host Ar hostname Ns : Ns Ar port , | ||
3120 | .Fl path Ar pathname | ||
3121 | .Xc | ||
2998 | If the | 3122 | If the |
2999 | .Fl host | 3123 | .Fl host |
3000 | option is present, then the OCSP request is sent to the host | 3124 | option is present, then the OCSP request is sent to the host |
@@ -3002,7 +3126,9 @@ option is present, then the OCSP request is sent to the host | |||
3002 | on port | 3126 | on port |
3003 | .Ar port . | 3127 | .Ar port . |
3004 | .Fl path | 3128 | .Fl path |
3005 | specifies the HTTP path name to use, or "/" by default. | 3129 | specifies the HTTP path name to use, or |
3130 | .Sq / | ||
3131 | by default. | ||
3006 | .It Fl CAfile Ar file , Fl CApath Ar pathname | 3132 | .It Fl CAfile Ar file , Fl CApath Ar pathname |
3007 | .Ar file | 3133 | .Ar file |
3008 | or | 3134 | or |
@@ -3049,16 +3175,16 @@ Don't check the signature on the OCSP response. | |||
3049 | Since this option tolerates invalid signatures on OCSP responses, | 3175 | Since this option tolerates invalid signatures on OCSP responses, |
3050 | it will normally only be used for testing purposes. | 3176 | it will normally only be used for testing purposes. |
3051 | .It Fl no_cert_verify | 3177 | .It Fl no_cert_verify |
3052 | Don't verify the OCSP response signers certificate at all. | 3178 | Don't verify the OCSP response signer's certificate at all. |
3053 | Since this option allows the OCSP response to be signed by any certificate, | 3179 | Since this option allows the OCSP response to be signed by any certificate, |
3054 | it should only be used for testing purposes. | 3180 | it should only be used for testing purposes. |
3055 | .It Fl no_chain | 3181 | .It Fl no_chain |
3056 | Do not use certificates in the response as additional untrusted CA | 3182 | Do not use certificates in the response as additional untrusted CA |
3057 | certificates. | 3183 | certificates. |
3058 | .It Fl no_cert_checks | 3184 | .It Fl no_cert_checks |
3059 | Don't perform any additional checks on the OCSP response signers certificate. | 3185 | Don't perform any additional checks on the OCSP response signer's certificate. |
3060 | That is, do not make any checks to see if the signers certificate is authorised | 3186 | That is, do not make any checks to see if the signer's certificate is |
3061 | to provide the necessary status information: | 3187 | authorised to provide the necessary status information: |
3062 | as a result this option should only be used for testing purposes. | 3188 | as a result this option should only be used for testing purposes. |
3063 | .It Fl validity_period Ar nsec , Fl status_age Ar age | 3189 | .It Fl validity_period Ar nsec , Fl status_age Ar age |
3064 | These options specify the range of times, in seconds, which will be tolerated | 3190 | These options specify the range of times, in seconds, which will be tolerated |
@@ -3079,14 +3205,14 @@ the default value is 5 minutes. | |||
3079 | .Pp | 3205 | .Pp |
3080 | If the | 3206 | If the |
3081 | .Em notAfter | 3207 | .Em notAfter |
3082 | time is omitted from a response then this means that new status | 3208 | time is omitted from a response, then this means that new status |
3083 | information is immediately available. | 3209 | information is immediately available. |
3084 | In this case the age of the | 3210 | In this case the age of the |
3085 | .Em notBefore | 3211 | .Em notBefore |
3086 | field is checked to see it is not older than | 3212 | field is checked to see it is not older than |
3087 | .Ar age | 3213 | .Ar age |
3088 | seconds old. | 3214 | seconds old. |
3089 | By default this additional check is not performed. | 3215 | By default, this additional check is not performed. |
3090 | .El | 3216 | .El |
3091 | .Sh OCSP SERVER OPTIONS | 3217 | .Sh OCSP SERVER OPTIONS |
3092 | .Bl -tag -width "XXXX" | 3218 | .Bl -tag -width "XXXX" |
@@ -3139,7 +3265,7 @@ Identify the signer certificate using the key ID, | |||
3139 | default is to use the subject name. | 3265 | default is to use the subject name. |
3140 | .It Fl rkey Ar file | 3266 | .It Fl rkey Ar file |
3141 | The private key to sign OCSP responses with; | 3267 | The private key to sign OCSP responses with; |
3142 | if not present the file specified in the | 3268 | if not present, the file specified in the |
3143 | .Fl rsigner | 3269 | .Fl rsigner |
3144 | option is used. | 3270 | option is used. |
3145 | .It Fl port Ar portnum | 3271 | .It Fl port Ar portnum |
@@ -3159,9 +3285,9 @@ or | |||
3159 | when fresh revocation information is available: used in the | 3285 | when fresh revocation information is available: used in the |
3160 | .Ar nextUpdate | 3286 | .Ar nextUpdate |
3161 | field. | 3287 | field. |
3162 | If neither option is present then the | 3288 | If neither option is present, then the |
3163 | .Em nextUpdate | 3289 | .Em nextUpdate |
3164 | field is omitted meaning fresh revocation information is immediately available. | 3290 | field is omitted, meaning fresh revocation information is immediately available. |
3165 | .El | 3291 | .El |
3166 | .Sh OCSP RESPONSE VERIFICATION | 3292 | .Sh OCSP RESPONSE VERIFICATION |
3167 | OCSP Response follows the rules specified in RFC 2560. | 3293 | OCSP Response follows the rules specified in RFC 2560. |
@@ -3181,7 +3307,7 @@ options or they will be looked for in the standard | |||
3181 | certificates | 3307 | certificates |
3182 | directory. | 3308 | directory. |
3183 | .Pp | 3309 | .Pp |
3184 | If the initial verify fails then the OCSP verify process halts with an | 3310 | If the initial verify fails, then the OCSP verify process halts with an |
3185 | error. | 3311 | error. |
3186 | .Pp | 3312 | .Pp |
3187 | Otherwise the issuing CA certificate in the request is compared to the OCSP | 3313 | Otherwise the issuing CA certificate in the request is compared to the OCSP |
@@ -3192,34 +3318,37 @@ CA certificate in the request. | |||
3192 | If there is a match and the OCSPSigning extended key usage is present | 3318 | If there is a match and the OCSPSigning extended key usage is present |
3193 | in the OCSP responder certificate, then the OCSP verify succeeds. | 3319 | in the OCSP responder certificate, then the OCSP verify succeeds. |
3194 | .Pp | 3320 | .Pp |
3195 | Otherwise the root CA of the OCSP responders CA is checked to see if it | 3321 | Otherwise the root CA of the OCSP responder's CA is checked to see if it |
3196 | is trusted for OCSP signing. | 3322 | is trusted for OCSP signing. |
3197 | If it is, the OCSP verify succeeds. | 3323 | If it is, the OCSP verify succeeds. |
3198 | .Pp | 3324 | .Pp |
3199 | If none of these checks is successful then the OCSP verify fails. | 3325 | If none of these checks is successful, then the OCSP verify fails. |
3200 | .Pp | 3326 | .Pp |
3201 | What this effectively means is that if the OCSP responder certificate is | 3327 | What this effectively means is that if the OCSP responder certificate is |
3202 | authorised directly by the CA it is issuing revocation information about | 3328 | authorised directly by the CA it is issuing revocation information about |
3203 | (and it is correctly configured) then verification will succeed. | 3329 | .Pq and it is correctly configured , |
3330 | then verification will succeed. | ||
3204 | .Pp | 3331 | .Pp |
3205 | If the OCSP responder is a | 3332 | If the OCSP responder is a |
3206 | .Em global responder | 3333 | .Em global responder |
3207 | which can give details about multiple CAs and has its own separate | 3334 | which can give details about multiple CAs and has its own separate |
3208 | certificate chain, then its root CA can be trusted for OCSP signing. | 3335 | certificate chain, then its root CA can be trusted for OCSP signing. |
3209 | For example: | 3336 | For example: |
3210 | .Bd -literal | 3337 | .Bd -literal -offset indent |
3211 | \& $ openssl x509 -in ocspCA.pem -addtrust OCSPSigning -out trustedCA.pem | 3338 | $ openssl x509 -in ocspCA.pem -addtrust OCSPSigning \e |
3339 | -out trustedCA.pem | ||
3212 | .Ed | 3340 | .Ed |
3213 | .Pp | 3341 | .Pp |
3214 | Alternatively the responder certificate itself can be explicitly trusted | 3342 | Alternatively, the responder certificate itself can be explicitly trusted |
3215 | with the | 3343 | with the |
3216 | .Fl VAfile | 3344 | .Fl VAfile |
3217 | option. | 3345 | option. |
3218 | .Sh OCSP NOTES | 3346 | .Sh OCSP NOTES |
3219 | As noted, most of the verify options are for testing or debugging purposes. | 3347 | As noted, most of the verify options are for testing or debugging purposes. |
3220 | Normally only the | 3348 | Normally, only the |
3221 | .Fl CApath , CAfile | 3349 | .Fl CApath , CAfile |
3222 | and (if the responder is a 'global VA') | 3350 | and |
3351 | .Pq if the responder is a `global VA' | ||
3223 | .Fl VAfile | 3352 | .Fl VAfile |
3224 | options need to be used. | 3353 | options need to be used. |
3225 | .Pp | 3354 | .Pp |
@@ -3243,49 +3372,48 @@ and | |||
3243 | options. | 3372 | options. |
3244 | .Sh OCSP EXAMPLES | 3373 | .Sh OCSP EXAMPLES |
3245 | Create an OCSP request and write it to a file: | 3374 | Create an OCSP request and write it to a file: |
3246 | .Bd -literal | 3375 | .Bd -literal -offset indent |
3247 | \& $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem -reqout \e | 3376 | $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e |
3248 | req.der | 3377 | -reqout req.der |
3249 | .Ed | 3378 | .Ed |
3250 | .Pp | 3379 | .Pp |
3251 | Send a query to an OCSP responder with URL | 3380 | Send a query to an OCSP responder with URL |
3252 | .Pa http://ocsp.myhost.com/ , | 3381 | .Pa http://ocsp.myhost.com/ , |
3253 | save the response to a file and print it out in text form: | 3382 | save the response to a file and print it out in text form: |
3254 | .Bd -literal | 3383 | .Bd -literal -offset indent |
3255 | \& $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e | 3384 | $ openssl ocsp -issuer issuer.pem -cert c1.pem -cert c2.pem \e |
3256 | \& -url http://ocsp.myhost.com/ -resp_text -respout resp.der | 3385 | -url http://ocsp.myhost.com/ -resp_text -respout resp.der |
3257 | .Ed | 3386 | .Ed |
3258 | .Pp | 3387 | .Pp |
3259 | Read in an OCSP response and print out text form: | 3388 | Read in an OCSP response and print out text form: |
3260 | .Bd -literal | 3389 | .Pp |
3261 | \& $ openssl ocsp -respin resp.der -text | 3390 | .Dl $ openssl ocsp -respin resp.der -text |
3262 | .Ed | ||
3263 | .Pp | 3391 | .Pp |
3264 | OCSP server on port 8888 using a standard | 3392 | OCSP server on port 8888 using a standard |
3265 | .Nm ca | 3393 | .Nm ca |
3266 | configuration, and a separate responder certificate. | 3394 | configuration, and a separate responder certificate. |
3267 | All requests and responses are printed to a file: | 3395 | All requests and responses are printed to a file: |
3268 | .Bd -literal | 3396 | .Bd -literal -offset indent |
3269 | \& $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem \e | 3397 | $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner \e |
3270 | -CA demoCA/cacert.pem -text -out log.txt | 3398 | rcert.pem -CA demoCA/cacert.pem -text -out log.txt |
3271 | .Ed | 3399 | .Ed |
3272 | .Pp | 3400 | .Pp |
3273 | As above, but exit after processing one request: | 3401 | As above, but exit after processing one request: |
3274 | .Bd -literal | 3402 | .Bd -literal -offset indent |
3275 | \& $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner rcert.pem \e | 3403 | $ openssl ocsp -index demoCA/index.txt -port 8888 -rsigner \e |
3276 | -CA demoCA/cacert.pem -nrequest 1 | 3404 | rcert.pem -CA demoCA/cacert.pem -nrequest 1 |
3277 | .Ed | 3405 | .Ed |
3278 | .Pp | 3406 | .Pp |
3279 | Query status information using internally generated request: | 3407 | Query status information using internally generated request: |
3280 | .Bd -literal | 3408 | .Bd -literal -offset indent |
3281 | \& $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e | 3409 | $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e |
3282 | demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1 | 3410 | demoCA/cacert.pem -issuer demoCA/cacert.pem -serial 1 |
3283 | .Ed | 3411 | .Ed |
3284 | .Pp | 3412 | .Pp |
3285 | Query status information using request read from a file, write response to a | 3413 | Query status information using request read from a file, write response to a |
3286 | second file: | 3414 | second file: |
3287 | .Bd -literal | 3415 | .Bd -literal -offset indent |
3288 | \& $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e | 3416 | $ openssl ocsp -index demoCA/index.txt -rsigner rcert.pem -CA \e |
3289 | demoCA/cacert.pem -reqin req.der -respout resp.der | 3417 | demoCA/cacert.pem -reqin req.der -respout resp.der |
3290 | .Ed | 3418 | .Ed |
3291 | .\" | 3419 | .\" |
@@ -3302,6 +3430,7 @@ second file: | |||
3302 | .Op Fl noverify | 3430 | .Op Fl noverify |
3303 | .Op Fl quiet | 3431 | .Op Fl quiet |
3304 | .Op Fl table | 3432 | .Op Fl table |
3433 | .Op Fl reverse | ||
3305 | .Op Ar password | 3434 | .Op Ar password |
3306 | .Pp | 3435 | .Pp |
3307 | The | 3436 | The |
@@ -3315,9 +3444,13 @@ for option | |||
3315 | from stdin for option | 3444 | from stdin for option |
3316 | .Fl stdin , | 3445 | .Fl stdin , |
3317 | or from the command line, or from the terminal otherwise. | 3446 | or from the command line, or from the terminal otherwise. |
3318 | The Unix standard algorithm | 3447 | The |
3448 | .Ux | ||
3449 | standard algorithm | ||
3319 | .Em crypt | 3450 | .Em crypt |
3320 | and the MD5-based BSD password algorithm | 3451 | and the MD5-based |
3452 | .Bx | ||
3453 | password algorithm | ||
3321 | .Em 1 | 3454 | .Em 1 |
3322 | and its Apache variant | 3455 | and its Apache variant |
3323 | .Em apr1 | 3456 | .Em apr1 |
@@ -3328,14 +3461,20 @@ The options are as follows: | |||
3328 | .It Fl crypt | 3461 | .It Fl crypt |
3329 | Use the | 3462 | Use the |
3330 | .Em crypt | 3463 | .Em crypt |
3331 | algorithm (default). | 3464 | algorithm |
3465 | .Pq default . | ||
3332 | .It Fl 1 | 3466 | .It Fl 1 |
3333 | Use the MD5 based BSD password algorithm | 3467 | Use the MD5 based |
3468 | .Bx | ||
3469 | password algorithm | ||
3334 | .Em 1 . | 3470 | .Em 1 . |
3335 | .It Fl apr1 | 3471 | .It Fl apr1 |
3336 | Use the | 3472 | Use the |
3337 | .Em apr1 | 3473 | .Em apr1 |
3338 | algorithm (Apache variant of the BSD algorithm). | 3474 | algorithm |
3475 | .Pq Apache variant of the | ||
3476 | .Bx | ||
3477 | algorithm. | ||
3339 | .It Fl salt Ar string | 3478 | .It Fl salt Ar string |
3340 | Use the specified | 3479 | Use the specified |
3341 | .Ar salt . | 3480 | .Ar salt . |
@@ -3350,31 +3489,33 @@ Read passwords from | |||
3350 | .It Fl noverify | 3489 | .It Fl noverify |
3351 | Don't verify when reading a password from the terminal. | 3490 | Don't verify when reading a password from the terminal. |
3352 | .It Fl quiet | 3491 | .It Fl quiet |
3353 | Don't output warnings when passwords given at the command line are truncated. | 3492 | Don't output warnings when passwords given on the command line are truncated. |
3354 | .It Fl table | 3493 | .It Fl table |
3355 | In the output list, prepend the cleartext password and a TAB character | 3494 | In the output list, prepend the cleartext password and a TAB character |
3356 | to each password hash. | 3495 | to each password hash. |
3496 | .It Fl reverse | ||
3497 | Switch table columns. | ||
3357 | .El | 3498 | .El |
3358 | .Sh PASSWD EXAMPLES | 3499 | .Sh PASSWD EXAMPLES |
3359 | .Bl -tag -width "XXXX" | 3500 | .Dl $ openssl passwd -crypt -salt xx password |
3360 | .It $ openssl passwd -crypt -salt xx password | ||
3361 | prints | 3501 | prints |
3362 | .Em xxj31ZMTZzkVA . | 3502 | .Qq xxj31ZMTZzkVA . |
3363 | .It $ openssl passwd -1 -salt xxxxxxxx password | 3503 | .Pp |
3504 | .Dl $ openssl passwd -1 -salt xxxxxxxx password | ||
3364 | prints | 3505 | prints |
3365 | .Em $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a. . | 3506 | .Qq $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a. . |
3366 | .It $ openssl passwd -apr1 -salt xxxxxxxx password | 3507 | .Pp |
3508 | .Dl $ openssl passwd -apr1 -salt xxxxxxxx password | ||
3367 | prints | 3509 | prints |
3368 | .Em $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0 . | 3510 | .Qq $apr1$xxxxxxxx$dxHfLAsjHkDRmG83UXe8K0 . |
3369 | .El | ||
3370 | .\" | 3511 | .\" |
3371 | .\" PKCS7 | 3512 | .\" PKCS7 |
3372 | .\" | 3513 | .\" |
3373 | .Sh PKCS7 | 3514 | .Sh PKCS7 |
3374 | .Nm openssl pkcs7 | 3515 | .Nm openssl pkcs7 |
3375 | .Bk -words | 3516 | .Bk -words |
3376 | .Op Fl inform Ar PEM|DER | 3517 | .Op Fl inform Ar DER | PEM |
3377 | .Op Fl outform Ar PEM|DER | 3518 | .Op Fl outform Ar DER | PEM |
3378 | .Op Fl in Ar filename | 3519 | .Op Fl in Ar filename |
3379 | .Op Fl out Ar filename | 3520 | .Op Fl out Ar filename |
3380 | .Op Fl print_certs | 3521 | .Op Fl print_certs |
@@ -3393,15 +3534,15 @@ format. | |||
3393 | .Pp | 3534 | .Pp |
3394 | The options are as follows: | 3535 | The options are as follows: |
3395 | .Bl -tag -width "XXXX" | 3536 | .Bl -tag -width "XXXX" |
3396 | .It Fl inform Ar DER|PEM | 3537 | .It Fl inform Ar DER | PEM |
3397 | This specifies the input format. | 3538 | This specifies the input format. |
3398 | .Ar DER | 3539 | .Ar DER |
3399 | format is DER encoded PKCS#7 v1.5 structure. | 3540 | format is a DER encoded PKCS#7 v1.5 structure. |
3400 | .Ar PEM | 3541 | .Ar PEM |
3401 | (the default) is a base64 encoded version of the DER form with header | 3542 | .Pq the default |
3402 | and footer lines. | 3543 | is a base64 encoded version of the DER form with header and footer lines. |
3403 | .It Fl outform Ar DER|PEM | 3544 | .It Fl outform Ar DER | PEM |
3404 | This specifies the output format, the options have the same meaning as the | 3545 | This specifies the output format; the options have the same meaning as the |
3405 | .Fl inform | 3546 | .Fl inform |
3406 | option. | 3547 | option. |
3407 | .It Fl in Ar filename | 3548 | .It Fl in Ar filename |
@@ -3427,7 +3568,7 @@ is set). | |||
3427 | Specifying an engine (by it's unique | 3568 | Specifying an engine (by it's unique |
3428 | .Ar id | 3569 | .Ar id |
3429 | string) will cause | 3570 | string) will cause |
3430 | .Nm req | 3571 | .Nm pkcs7 |
3431 | to attempt to obtain a functional reference to the specified engine, | 3572 | to attempt to obtain a functional reference to the specified engine, |
3432 | thus initialising it if needed. | 3573 | thus initialising it if needed. |
3433 | The engine will then be set as the default for all available algorithms. | 3574 | The engine will then be set as the default for all available algorithms. |
@@ -3438,24 +3579,24 @@ Convert a PKCS#7 file from | |||
3438 | to | 3579 | to |
3439 | .Em DER : | 3580 | .Em DER : |
3440 | .Pp | 3581 | .Pp |
3441 | \& $ openssl pkcs7 -in file.pem -outform DER -out file.der | 3582 | .Dl $ openssl pkcs7 -in file.pem -outform DER -out file.der |
3442 | .Pp | 3583 | .Pp |
3443 | Output all certificates in a file: | 3584 | Output all certificates in a file: |
3444 | .Pp | 3585 | .Pp |
3445 | \& $ openssl pkcs7 -in file.pem -print_certs -out certs.pem | 3586 | .Dl $ openssl pkcs7 -in file.pem -print_certs -out certs.pem |
3446 | .Sh PKCS7 NOTES | 3587 | .Sh PKCS7 NOTES |
3447 | The | 3588 | The |
3448 | .Em PEM | 3589 | .Em PEM |
3449 | PKCS#7 format uses the header and footer lines: | 3590 | PKCS#7 format uses the header and footer lines: |
3450 | .Bd -literal | 3591 | .Bd -unfilled -offset indent |
3451 | \& -----BEGIN PKCS7----- | 3592 | -----BEGIN PKCS7----- |
3452 | \& -----END PKCS7----- | 3593 | -----END PKCS7----- |
3453 | .Ed | 3594 | .Ed |
3454 | .Pp | 3595 | .Pp |
3455 | For compatibility with some CAs it will also accept: | 3596 | For compatibility with some CAs it will also accept: |
3456 | .Bd -literal | 3597 | .Bd -unfilled -offset indent |
3457 | \& -----BEGIN CERTIFICATE----- | 3598 | -----BEGIN CERTIFICATE----- |
3458 | \& -----END CERTIFICATE----- | 3599 | -----END CERTIFICATE----- |
3459 | .Ed | 3600 | .Ed |
3460 | .Sh PKCS7 RESTRICTIONS | 3601 | .Sh PKCS7 RESTRICTIONS |
3461 | There is no option to print out all the fields of a PKCS#7 file. | 3602 | There is no option to print out all the fields of a PKCS#7 file. |
@@ -3469,8 +3610,8 @@ They cannot currently parse, for example, the new CMS as described in RFC 2630. | |||
3469 | .Nm openssl pkcs8 | 3610 | .Nm openssl pkcs8 |
3470 | .Bk -words | 3611 | .Bk -words |
3471 | .Op Fl topk8 | 3612 | .Op Fl topk8 |
3472 | .Op Fl inform Ar PEM|DER | 3613 | .Op Fl inform Ar DER | PEM |
3473 | .Op Fl outform Ar PEM|DER | 3614 | .Op Fl outform Ar DER | PEM |
3474 | .Op Fl in Ar filename | 3615 | .Op Fl in Ar filename |
3475 | .Op Fl passin Ar arg | 3616 | .Op Fl passin Ar arg |
3476 | .Op Fl out Ar filename | 3617 | .Op Fl out Ar filename |
@@ -3490,18 +3631,19 @@ The | |||
3490 | command processes private keys in PKCS#8 format. | 3631 | command processes private keys in PKCS#8 format. |
3491 | It can handle both unencrypted PKCS#8 PrivateKeyInfo format | 3632 | It can handle both unencrypted PKCS#8 PrivateKeyInfo format |
3492 | and EncryptedPrivateKeyInfo format with a variety of PKCS#5 | 3633 | and EncryptedPrivateKeyInfo format with a variety of PKCS#5 |
3493 | (v1.5 and v2.0) and PKCS#12 algorithms. | 3634 | .Pq v1.5 and v2.0 |
3635 | and PKCS#12 algorithms. | ||
3494 | .Pp | 3636 | .Pp |
3495 | The options are as follows: | 3637 | The options are as follows: |
3496 | .Bl -tag -width "XXXX" | 3638 | .Bl -tag -width "XXXX" |
3497 | .It Fl topk8 | 3639 | .It Fl topk8 |
3498 | Normally a PKCS#8 private key is expected on input and a traditional format | 3640 | Normally, a PKCS#8 private key is expected on input and a traditional format |
3499 | private key will be written. | 3641 | private key will be written. |
3500 | With the | 3642 | With the |
3501 | .Fl topk8 | 3643 | .Fl topk8 |
3502 | option the situation is reversed: | 3644 | option the situation is reversed: |
3503 | it reads a traditional format private key and writes a PKCS#8 format key. | 3645 | it reads a traditional format private key and writes a PKCS#8 format key. |
3504 | .It Fl inform Ar DER|PEM | 3646 | .It Fl inform Ar DER | PEM |
3505 | This specifies the input format. | 3647 | This specifies the input format. |
3506 | If a PKCS#8 format key is expected on input, | 3648 | If a PKCS#8 format key is expected on input, |
3507 | then either a | 3649 | then either a |
@@ -3514,19 +3656,19 @@ Otherwise the | |||
3514 | or | 3656 | or |
3515 | .Em PEM | 3657 | .Em PEM |
3516 | format of the traditional format private key is used. | 3658 | format of the traditional format private key is used. |
3517 | .It Fl outform Ar DER|PEM | 3659 | .It Fl outform Ar DER | PEM |
3518 | This specifies the output format, the options have the same meaning as the | 3660 | This specifies the output format; the options have the same meaning as the |
3519 | .Fl inform | 3661 | .Fl inform |
3520 | option. | 3662 | option. |
3521 | .It Fl in Ar filename | 3663 | .It Fl in Ar filename |
3522 | This specifies the input | 3664 | This specifies the input |
3523 | .Ar filename | 3665 | .Ar filename |
3524 | to read a key from or standard input if this option is not specified. | 3666 | to read a key from or standard input if this option is not specified. |
3525 | If the key is encrypted a pass phrase will be prompted for. | 3667 | If the key is encrypted, a pass phrase will be prompted for. |
3526 | .It Fl passin Ar arg | 3668 | .It Fl passin Ar arg |
3527 | The input file password source. | 3669 | The input file password source. |
3528 | For more information about the format of | 3670 | For more information about the format of |
3529 | .Ar arg | 3671 | .Ar arg , |
3530 | see the | 3672 | see the |
3531 | .Sx PASS PHRASE ARGUMENTS | 3673 | .Sx PASS PHRASE ARGUMENTS |
3532 | section above. | 3674 | section above. |
@@ -3541,7 +3683,7 @@ be the same as the input filename. | |||
3541 | .It Fl passout Ar arg | 3683 | .It Fl passout Ar arg |
3542 | The output file password source. | 3684 | The output file password source. |
3543 | For more information about the format of | 3685 | For more information about the format of |
3544 | .Ar arg | 3686 | .Ar arg , |
3545 | see the | 3687 | see the |
3546 | .Sx PASS PHRASE ARGUMENTS | 3688 | .Sx PASS PHRASE ARGUMENTS |
3547 | section above. | 3689 | section above. |
@@ -3579,15 +3721,15 @@ The | |||
3579 | contains a SEQUENCE consisting of the public and private keys, respectively. | 3721 | contains a SEQUENCE consisting of the public and private keys, respectively. |
3580 | .It Fl v2 Ar alg | 3722 | .It Fl v2 Ar alg |
3581 | This option enables the use of PKCS#5 v2.0 algorithms. | 3723 | This option enables the use of PKCS#5 v2.0 algorithms. |
3582 | Normally PKCS#8 private keys are encrypted with the password based | 3724 | Normally, PKCS#8 private keys are encrypted with the password based |
3583 | encryption algorithm called | 3725 | encryption algorithm called |
3584 | .Em pbeWithMD5AndDES-CBC ; | 3726 | .Em pbeWithMD5AndDES-CBC ; |
3585 | this uses 56 bit DES encryption but it was the strongest encryption | 3727 | this uses 56-bit DES encryption but it was the strongest encryption |
3586 | algorithm supported in PKCS#5 v1.5. | 3728 | algorithm supported in PKCS#5 v1.5. |
3587 | Using the | 3729 | Using the |
3588 | .Fl v2 | 3730 | .Fl v2 |
3589 | option PKCS#5 v2.0 algorithms are used which can use any | 3731 | option PKCS#5 v2.0 algorithms are used which can use any |
3590 | encryption algorithm such as 168 bit triple DES or 128 bit RC2, however | 3732 | encryption algorithm such as 168-bit triple DES or 128-bit RC2, however |
3591 | not many implementations support PKCS#5 v2.0 yet. | 3733 | not many implementations support PKCS#5 v2.0 yet. |
3592 | If using private keys with | 3734 | If using private keys with |
3593 | .Nm OpenSSL | 3735 | .Nm OpenSSL |
@@ -3609,7 +3751,7 @@ A complete list of possible algorithms is included below. | |||
3609 | Specifying an engine (by it's unique | 3751 | Specifying an engine (by it's unique |
3610 | .Ar id | 3752 | .Ar id |
3611 | string) will cause | 3753 | string) will cause |
3612 | .Nm req | 3754 | .Nm pkcs8 |
3613 | to attempt to obtain a functional reference to the specified engine, | 3755 | to attempt to obtain a functional reference to the specified engine, |
3614 | thus initialising it if needed. | 3756 | thus initialising it if needed. |
3615 | The engine will then be set as the default for all available algorithms. | 3757 | The engine will then be set as the default for all available algorithms. |
@@ -3619,15 +3761,15 @@ The encrypted form of a | |||
3619 | .Em PEM | 3761 | .Em PEM |
3620 | encoded PKCS#8 file uses the following | 3762 | encoded PKCS#8 file uses the following |
3621 | headers and footers: | 3763 | headers and footers: |
3622 | .Bd -literal | 3764 | .Bd -unfilled -offset indent |
3623 | \& -----BEGIN ENCRYPTED PRIVATE KEY----- | 3765 | -----BEGIN ENCRYPTED PRIVATE KEY----- |
3624 | \& -----END ENCRYPTED PRIVATE KEY----- | 3766 | -----END ENCRYPTED PRIVATE KEY----- |
3625 | .Ed | 3767 | .Ed |
3626 | .Pp | 3768 | .Pp |
3627 | The unencrypted form uses: | 3769 | The unencrypted form uses: |
3628 | .Bd -literal | 3770 | .Bd -unfilled -offset indent |
3629 | \& -----BEGIN PRIVATE KEY----- | 3771 | -----BEGIN PRIVATE KEY----- |
3630 | \& -----END PRIVATE KEY----- | 3772 | -----END PRIVATE KEY----- |
3631 | .Ed | 3773 | .Ed |
3632 | .Pp | 3774 | .Pp |
3633 | Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration | 3775 | Private keys encrypted using PKCS#5 v2.0 algorithms and high iteration |
@@ -3655,49 +3797,59 @@ Various algorithms can be used with the | |||
3655 | .Fl v1 | 3797 | .Fl v1 |
3656 | command line option, including PKCS#5 v1.5 and PKCS#12. | 3798 | command line option, including PKCS#5 v1.5 and PKCS#12. |
3657 | These are described in more detail below. | 3799 | These are described in more detail below. |
3658 | .Bl -tag -width "XXXX" | 3800 | .Pp |
3659 | .It Ar PBE-MD2-DES PBE-MD5-DES | 3801 | .Bl -tag -width "XXXX" -compact |
3802 | .It Ar PBE-MD2-DES | PBE-MD5-DES | ||
3660 | These algorithms were included in the original PKCS#5 v1.5 specification. | 3803 | These algorithms were included in the original PKCS#5 v1.5 specification. |
3661 | They only offer 56 bits of protection since they both use DES. | 3804 | They only offer 56 bits of protection since they both use DES. |
3662 | .It Ar PBE-SHA1-RC2-64 PBE-MD2-RC2-64 PBE-MD5-RC2-64 PBE-SHA1-DES | 3805 | .Pp |
3806 | .It Ar PBE-SHA1-RC2-64 | PBE-MD2-RC2-64 | PBE-MD5-RC2-64 | PBE-SHA1-DES | ||
3663 | These algorithms are not mentioned in the original PKCS#5 v1.5 specification | 3807 | These algorithms are not mentioned in the original PKCS#5 v1.5 specification |
3664 | but they use the same key derivation algorithm and are supported by some | 3808 | but they use the same key derivation algorithm and are supported by some |
3665 | software. | 3809 | software. |
3666 | They are mentioned in PKCS#5 v2.0. | 3810 | They are mentioned in PKCS#5 v2.0. |
3667 | They use either 64 bit RC2 or 56 bit DES. | 3811 | They use either 64-bit RC2 or 56-bit DES. |
3668 | .It Ar PBE-SHA1-RC4-128 PBE-SHA1-RC4-40 PBE-SHA1-3DES PBE-SHA1-2DES PBE-SHA1-RC2-128 PBE-SHA1-RC2-40 | 3812 | .Pp |
3813 | .It Ar PBE-SHA1-RC4-128 | PBE-SHA1-RC4-40 | PBE-SHA1-3DES | PBE-SHA1-2DES | ||
3814 | .It Ar PBE-SHA1-RC2-128 | PBE-SHA1-RC2-40 | ||
3669 | These algorithms use the PKCS#12 password based encryption algorithm and | 3815 | These algorithms use the PKCS#12 password based encryption algorithm and |
3670 | allow strong encryption algorithms like triple DES or 128 bit RC2 to be used. | 3816 | allow strong encryption algorithms like triple DES or 128-bit RC2 to be used. |
3671 | .El | 3817 | .El |
3672 | .Sh PKCS8 EXAMPLES | 3818 | .Sh PKCS8 EXAMPLES |
3673 | Convert a private from traditional to PKCS#5 v2.0 format using triple DES: | 3819 | Convert a private key from traditional to PKCS#5 v2.0 format using triple DES: |
3674 | .Pp | 3820 | .Pp |
3675 | \& $ openssl pkcs8 -in key.pem -topk8 -v2 des3 -out enckey.pem | 3821 | .Dl "$ openssl pkcs8 -in key.pem -topk8 -v2 des3 -out enckey.pem" |
3676 | .Pp | 3822 | .Pp |
3677 | Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm (DES): | 3823 | Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm |
3824 | .Pq DES : | ||
3678 | .Pp | 3825 | .Pp |
3679 | \& $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem | 3826 | .Dl $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem |
3680 | .Pp | 3827 | .Pp |
3681 | Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm (3DES): | 3828 | Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm |
3682 | .Pp | 3829 | .Pq 3DES : |
3683 | \& $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem -v1 PBE-SHA1-3DES | 3830 | .Bd -literal -offset indent |
3831 | $ openssl pkcs8 -in key.pem -topk8 -out enckey.pem \e | ||
3832 | -v1 PBE-SHA1-3DES | ||
3833 | .Ed | ||
3684 | .Pp | 3834 | .Pp |
3685 | Read a DER unencrypted PKCS#8 format private key: | 3835 | Read a DER unencrypted PKCS#8 format private key: |
3686 | .Pp | 3836 | .Pp |
3687 | \& $ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem | 3837 | .Dl "$ openssl pkcs8 -inform DER -nocrypt -in key.der -out key.pem" |
3688 | .Pp | 3838 | .Pp |
3689 | Convert a private key from any PKCS#8 format to traditional format: | 3839 | Convert a private key from any PKCS#8 format to traditional format: |
3690 | .Pp | 3840 | .Pp |
3691 | \& $ openssl pkcs8 -in pk8.pem -out key.pem | 3841 | .Dl $ openssl pkcs8 -in pk8.pem -out key.pem |
3692 | .Sh PKCS8 STANDARDS | 3842 | .Sh PKCS8 STANDARDS |
3693 | Test vectors from this PKCS#5 v2.0 implementation were posted to the | 3843 | Test vectors from this PKCS#5 v2.0 implementation were posted to the |
3694 | pkcs-tng mailing list using triple DES, DES and RC2 with high iteration | 3844 | pkcs-tng mailing list using triple DES, DES and RC2 with high iteration counts; |
3695 | counts, several people confirmed that they could decrypt the private | 3845 | several people confirmed that they could decrypt the private |
3696 | keys produced and therefore it can be assumed that the PKCS#5 v2.0 | 3846 | keys produced and therefore it can be assumed that the PKCS#5 v2.0 |
3697 | implementation is reasonably accurate at least as far as these | 3847 | implementation is reasonably accurate at least as far as these |
3698 | algorithms are concerned. | 3848 | algorithms are concerned. |
3699 | .Pp | 3849 | .Pp |
3700 | The format of PKCS#8 DSA (and other) private keys is not well documented: | 3850 | The format of PKCS#8 DSA |
3851 | .Pq and other | ||
3852 | private keys is not well documented: | ||
3701 | it is hidden away in PKCS#11 v2.01, section 11.9.; | 3853 | it is hidden away in PKCS#11 v2.01, section 11.9.; |
3702 | .Nm OpenSSL Ns Li 's | 3854 | .Nm OpenSSL Ns Li 's |
3703 | default DSA PKCS#8 private key format complies with this standard. | 3855 | default DSA PKCS#8 private key format complies with this standard. |
@@ -3714,10 +3866,13 @@ compatibility, several of the utilities use the old format at present. | |||
3714 | .\" | 3866 | .\" |
3715 | .Sh PKCS12 | 3867 | .Sh PKCS12 |
3716 | .Nm "openssl pkcs12" | 3868 | .Nm "openssl pkcs12" |
3869 | .Bk -words | ||
3717 | .Op Fl export | 3870 | .Op Fl export |
3718 | .Op Fl chain | 3871 | .Op Fl chain |
3719 | .Op Fl inkey Ar filename | 3872 | .Op Fl inkey Ar filename |
3720 | .Op Fl certfile Ar filename | 3873 | .Op Fl certfile Ar filename |
3874 | .Op Fl CApath Ar directory | ||
3875 | .Op Fl CAfile Ar filename | ||
3721 | .Op Fl name Ar name | 3876 | .Op Fl name Ar name |
3722 | .Op Fl caname Ar name | 3877 | .Op Fl caname Ar name |
3723 | .Op Fl in Ar filename | 3878 | .Op Fl in Ar filename |
@@ -3729,9 +3884,10 @@ compatibility, several of the utilities use the old format at present. | |||
3729 | .Op Fl cacerts | 3884 | .Op Fl cacerts |
3730 | .Op Fl nokeys | 3885 | .Op Fl nokeys |
3731 | .Op Fl info | 3886 | .Op Fl info |
3732 | .Op Fl des | 3887 | .Oo |
3733 | .Op Fl des3 | 3888 | .Fl des | des3 | aes128 | |
3734 | .Op Fl idea | 3889 | .Fl aes192 | aes256 |
3890 | .Oc | ||
3735 | .Op Fl nodes | 3891 | .Op Fl nodes |
3736 | .Op Fl noiter | 3892 | .Op Fl noiter |
3737 | .Op Fl maciter | 3893 | .Op Fl maciter |
@@ -3745,20 +3901,24 @@ compatibility, several of the utilities use the old format at present. | |||
3745 | .Op Fl passin Ar arg | 3901 | .Op Fl passin Ar arg |
3746 | .Op Fl passout Ar arg | 3902 | .Op Fl passout Ar arg |
3747 | .Op Fl rand Ar file ... | 3903 | .Op Fl rand Ar file ... |
3904 | .Op Fl engine Ar id | ||
3905 | .Ek | ||
3748 | .Pp | 3906 | .Pp |
3749 | The | 3907 | The |
3750 | .Nm pkcs12 | 3908 | .Nm pkcs12 |
3751 | command allows PKCS#12 files (sometimes referred to as PFX files) | 3909 | command allows PKCS#12 files |
3910 | .Pq sometimes referred to as PFX files | ||
3752 | to be created and parsed. | 3911 | to be created and parsed. |
3753 | PKCS#12 files are used by several programs including Netscape, MSIE | 3912 | PKCS#12 files are used by several programs including Netscape, MSIE |
3754 | and MS Outlook. | 3913 | and MS Outlook. |
3755 | .Pp | 3914 | .Pp |
3756 | There are a lot of options; the meaning of some depends on whether a | 3915 | There are a lot of options; the meaning of some depends on whether a |
3757 | PKCS#12 file is being created or parsed. | 3916 | PKCS#12 file is being created or parsed. |
3758 | By default a PKCS#12 file is parsed; | 3917 | By default, a PKCS#12 file is parsed; |
3759 | a PKCS#12 file can be created by using the | 3918 | a PKCS#12 file can be created by using the |
3760 | .Fl export | 3919 | .Fl export |
3761 | option (see below). | 3920 | option |
3921 | .Pq see below . | ||
3762 | .Sh PKCS12 PARSING OPTIONS | 3922 | .Sh PKCS12 PARSING OPTIONS |
3763 | .Bl -tag -width "XXXX" | 3923 | .Bl -tag -width "XXXX" |
3764 | .It Fl in Ar filename | 3924 | .It Fl in Ar filename |
@@ -3774,16 +3934,18 @@ They are all written in | |||
3774 | .Em PEM | 3934 | .Em PEM |
3775 | format. | 3935 | format. |
3776 | .It Fl pass Ar arg , Fl passin Ar arg | 3936 | .It Fl pass Ar arg , Fl passin Ar arg |
3777 | The PKCS#12 file (i.e. input file) password source. | 3937 | The PKCS#12 file |
3938 | .Pq i.e. input file | ||
3939 | password source. | ||
3778 | For more information about the format of | 3940 | For more information about the format of |
3779 | .Ar arg | 3941 | .Ar arg , |
3780 | see the | 3942 | see the |
3781 | .Sx PASS PHRASE ARGUMENTS | 3943 | .Sx PASS PHRASE ARGUMENTS |
3782 | section above. | 3944 | section above. |
3783 | .It Fl passout Ar arg | 3945 | .It Fl passout Ar arg |
3784 | Pass phrase source to encrypt any outputed private keys with. | 3946 | Pass phrase source to encrypt any outputed private keys with. |
3785 | For more information about the format of | 3947 | For more information about the format of |
3786 | .Ar arg | 3948 | .Ar arg , |
3787 | see the | 3949 | see the |
3788 | .Sx PASS PHRASE ARGUMENTS | 3950 | .Sx PASS PHRASE ARGUMENTS |
3789 | section above. | 3951 | section above. |
@@ -3791,9 +3953,11 @@ section above. | |||
3791 | This option inhibits output of the keys and certificates to the output file | 3953 | This option inhibits output of the keys and certificates to the output file |
3792 | version of the PKCS#12 file. | 3954 | version of the PKCS#12 file. |
3793 | .It Fl clcerts | 3955 | .It Fl clcerts |
3794 | Only output client certificates (not CA certificates). | 3956 | Only output client certificates |
3957 | .Pq not CA certificates . | ||
3795 | .It Fl cacerts | 3958 | .It Fl cacerts |
3796 | Only output CA certificates (not client certificates). | 3959 | Only output CA certificates |
3960 | .Pq not client certificates . | ||
3797 | .It Fl nocerts | 3961 | .It Fl nocerts |
3798 | No certificates at all will be output. | 3962 | No certificates at all will be output. |
3799 | .It Fl nokeys | 3963 | .It Fl nokeys |
@@ -3801,12 +3965,13 @@ No private keys will be output. | |||
3801 | .It Fl info | 3965 | .It Fl info |
3802 | Output additional information about the PKCS#12 file structure, | 3966 | Output additional information about the PKCS#12 file structure, |
3803 | algorithms used and iteration counts. | 3967 | algorithms used and iteration counts. |
3804 | .It Fl des | 3968 | .It Xo |
3805 | Use DES to encrypt private keys before outputting. | 3969 | .Fl des | des3 | aes128 | |
3806 | .It Fl des3 | 3970 | .Fl aes192 | aes256 |
3807 | Use triple DES to encrypt private keys before outputting, this is the default. | 3971 | .Xc |
3808 | .It Fl idea | 3972 | Use DES, triple DES, or AES, respectively, |
3809 | Use IDEA to encrypt private keys before outputting. | 3973 | to encrypt private keys before outputting. |
3974 | The default is triple DES. | ||
3810 | .It Fl nodes | 3975 | .It Fl nodes |
3811 | Don't encrypt the private keys at all. | 3976 | Don't encrypt the private keys at all. |
3812 | .It Fl nomacver | 3977 | .It Fl nomacver |
@@ -3841,72 +4006,89 @@ in the PKCS#12 file. | |||
3841 | File to read private key from. | 4006 | File to read private key from. |
3842 | If not present then a private key must be present in the input file. | 4007 | If not present then a private key must be present in the input file. |
3843 | .It Fl name Ar friendlyname | 4008 | .It Fl name Ar friendlyname |
3844 | This specifies the "friendly name" for the certificate and private key. | 4009 | This specifies the |
4010 | .Qq friendly name | ||
4011 | for the certificate and private key. | ||
3845 | This name is typically displayed in list boxes by software importing the file. | 4012 | This name is typically displayed in list boxes by software importing the file. |
3846 | .It Fl certfile Ar filename | 4013 | .It Fl certfile Ar filename |
3847 | A filename to read additional certificates from. | 4014 | A filename to read additional certificates from. |
4015 | .It Fl CApath Ar directory | ||
4016 | Directory of CAs | ||
4017 | .Pq PEM format . | ||
4018 | .It Fl CAfile Ar filename | ||
4019 | File of CAs | ||
4020 | .Pq PEM format . | ||
3848 | .It Fl caname Ar friendlyname | 4021 | .It Fl caname Ar friendlyname |
3849 | This specifies the "friendly name" for other certificates. | 4022 | This specifies the |
4023 | .Qq friendly name | ||
4024 | for other certificates. | ||
3850 | This option may be used multiple times to specify names for all certificates | 4025 | This option may be used multiple times to specify names for all certificates |
3851 | in the order they appear. | 4026 | in the order they appear. |
3852 | Netscape ignores friendly names on other certificates, | 4027 | Netscape ignores friendly names on other certificates, |
3853 | whereas MSIE displays them. | 4028 | whereas MSIE displays them. |
3854 | .It Fl pass Ar arg , Fl passout Ar arg | 4029 | .It Fl pass Ar arg , Fl passout Ar arg |
3855 | The PKCS#12 file (i.e. output file) password source. | 4030 | The PKCS#12 file |
4031 | .Pq i.e. output file | ||
4032 | password source. | ||
3856 | For more information about the format of | 4033 | For more information about the format of |
3857 | .Ar arg | 4034 | .Ar arg , |
3858 | see the | 4035 | see the |
3859 | .Sx PASS PHRASE ARGUMENTS | 4036 | .Sx PASS PHRASE ARGUMENTS |
3860 | section above. | 4037 | section above. |
3861 | .It Fl passin Ar password | 4038 | .It Fl passin Ar password |
3862 | Pass phrase source to decrypt any input private keys with. | 4039 | Pass phrase source to decrypt any input private keys with. |
3863 | For more information about the format of | 4040 | For more information about the format of |
3864 | .Ar arg | 4041 | .Ar arg , |
3865 | see the | 4042 | see the |
3866 | .Sx PASS PHRASE ARGUMENTS | 4043 | .Sx PASS PHRASE ARGUMENTS |
3867 | section above. | 4044 | section above. |
3868 | .It Fl chain | 4045 | .It Fl chain |
3869 | If this option is present then an attempt is made to include the entire | 4046 | If this option is present, then an attempt is made to include the entire |
3870 | certificate chain of the user certificate. | 4047 | certificate chain of the user certificate. |
3871 | The standard CA store is used for this search. | 4048 | The standard CA store is used for this search. |
3872 | If the search fails it is considered a fatal error. | 4049 | If the search fails, it is considered a fatal error. |
3873 | .It Fl descert | 4050 | .It Fl descert |
3874 | Encrypt the certificate using triple DES; this may render the PKCS#12 | 4051 | Encrypt the certificate using triple DES; this may render the PKCS#12 |
3875 | file unreadable by some "export grade" software. | 4052 | file unreadable by some |
3876 | By default the private key is encrypted using triple DES and the | 4053 | .Qq export grade |
3877 | certificate using 40 bit RC2. | 4054 | software. |
4055 | By default, the private key is encrypted using triple DES and the | ||
4056 | certificate using 40-bit RC2. | ||
3878 | .It Fl keypbe Ar alg , Fl certpbe Ar alg | 4057 | .It Fl keypbe Ar alg , Fl certpbe Ar alg |
3879 | These options allow the algorithm used to encrypt the private key and | 4058 | These options allow the algorithm used to encrypt the private key and |
3880 | certificates to be selected. | 4059 | certificates to be selected. |
3881 | Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected, | 4060 | Although any PKCS#5 v1.5 or PKCS#12 algorithms can be selected, |
3882 | it is advisable only to use PKCS#12 algorithms. | 4061 | it is advisable to only use PKCS#12 algorithms. |
3883 | See the list in the | 4062 | See the list in the |
3884 | .Sx PKCS12 NOTES | 4063 | .Sx PKCS12 NOTES |
3885 | section for more information. | 4064 | section for more information. |
3886 | .It Fl keyex | keysig | 4065 | .It Fl keyex | keysig |
3887 | Specifies that the private key is to be used for key exchange or just signing. | 4066 | Specifies that the private key is to be used for key exchange or just signing. |
3888 | This option is only interpreted by MSIE and similar MS software. | 4067 | This option is only interpreted by MSIE and similar MS software. |
3889 | Normally "export grade" software will only allow 512 bit RSA keys to be | 4068 | Normally, |
4069 | .Qq export grade | ||
4070 | software will only allow 512-bit RSA keys to be | ||
3890 | used for encryption purposes, but arbitrary length keys for signing. | 4071 | used for encryption purposes, but arbitrary length keys for signing. |
3891 | The | 4072 | The |
3892 | .Fl keysig | 4073 | .Fl keysig |
3893 | option marks the key for signing only. | 4074 | option marks the key for signing only. |
3894 | Signing only keys can be used for S/MIME signing, | 4075 | Signing only keys can be used for S/MIME signing, authenticode |
3895 | authenticode (ActiveX control signing) and SSL client authentication; | 4076 | .Pq ActiveX control signing |
4077 | and SSL client authentication; | ||
3896 | however, due to a bug only MSIE 5.0 and later support | 4078 | however, due to a bug only MSIE 5.0 and later support |
3897 | the use of signing only keys for SSL client authentication. | 4079 | the use of signing only keys for SSL client authentication. |
3898 | .It Fl nomaciter , noiter | 4080 | .It Fl nomaciter , noiter |
3899 | These options affect the iteration counts on the MAC and key algorithms. | 4081 | These options affect the iteration counts on the MAC and key algorithms. |
3900 | Unless you wish to produce files compatible with MSIE 4.0 you should leave | 4082 | Unless you wish to produce files compatible with MSIE 4.0, you should leave |
3901 | these options alone. | 4083 | these options alone. |
3902 | .Pp | 4084 | .Pp |
3903 | To discourage attacks by using large dictionaries of common passwords the | 4085 | To discourage attacks by using large dictionaries of common passwords, |
3904 | algorithm that derives keys from passwords can have an iteration count applied | 4086 | the algorithm that derives keys from passwords can have an iteration count |
3905 | to it: this causes a certain part of the algorithm to be repeated and slows it | 4087 | applied to it: this causes a certain part of the algorithm to be repeated |
3906 | down. | 4088 | and slows it down. |
3907 | The MAC is used to check the file integrity but since it will normally | 4089 | The MAC is used to check the file integrity but since it will normally |
3908 | have the same password as the keys and certificates it could also be attacked. | 4090 | have the same password as the keys and certificates it could also be attacked. |
3909 | By default both MAC and encryption iteration counts are set to 2048; | 4091 | By default, both MAC and encryption iteration counts are set to 2048; |
3910 | using these options the MAC and encryption iteration counts can be set to 1. | 4092 | using these options the MAC and encryption iteration counts can be set to 1. |
3911 | Since this reduces the file security you should not use these options | 4093 | Since this reduces the file security you should not use these options |
3912 | unless you really have to. | 4094 | unless you really have to. |
@@ -3915,29 +4097,28 @@ MSIE 4.0 doesn't support MAC iteration counts, so it needs the | |||
3915 | .Fl nomaciter | 4097 | .Fl nomaciter |
3916 | option. | 4098 | option. |
3917 | .It Fl maciter | 4099 | .It Fl maciter |
3918 | This option is included for compatibility with previous versions, it used | 4100 | This option is included for compatibility with previous versions; it used |
3919 | to be needed to use MAC iterations counts but they are now used by default. | 4101 | to be needed to use MAC iterations counts but they are now used by default. |
3920 | .It Fl rand Ar file ... | 4102 | .It Fl rand Ar file ... |
3921 | A | 4103 | A file or files |
3922 | .Ar file | ||
3923 | or | ||
3924 | .Ar file Ns Li s | ||
3925 | containing random data used to seed the random number generator, | 4104 | containing random data used to seed the random number generator, |
3926 | or an EGD socket (see | 4105 | or an EGD socket (see |
3927 | .Xr RAND_egd 3 ) . | 4106 | .Xr RAND_egd 3 ) . |
3928 | Multiple files can be specified separated by an OS-dependent character. | 4107 | Multiple files can be specified separated by a |
3929 | The separator is | 4108 | .Sq \&: . |
3930 | .Cm \&; | 4109 | .It Fl engine Ar id |
3931 | for MS-Windows, | 4110 | Specifying an engine (by it's unique |
3932 | .Cm \&, | 4111 | .Ar id |
3933 | for OpenVMS, and | 4112 | string) will cause |
3934 | .Cm \&: | 4113 | .Nm pkcs12 |
3935 | for all others. | 4114 | to attempt to obtain a functional reference to the specified engine, |
4115 | thus initialising it if needed. | ||
4116 | The engine will then be set as the default for all available algorithms. | ||
3936 | .El | 4117 | .El |
3937 | .Sh PKCS12 NOTES | 4118 | .Sh PKCS12 NOTES |
3938 | Although there are a large number of options, | 4119 | Although there are a large number of options, |
3939 | most of them are very rarely used. | 4120 | most of them are very rarely used. |
3940 | For PKCS#12 file parsing only | 4121 | For PKCS#12 file parsing, only |
3941 | .Fl in | 4122 | .Fl in |
3942 | and | 4123 | and |
3943 | .Fl out | 4124 | .Fl out |
@@ -3948,10 +4129,10 @@ and | |||
3948 | are also used. | 4129 | are also used. |
3949 | .Pp | 4130 | .Pp |
3950 | If none of the | 4131 | If none of the |
3951 | .Fl clcerts , cacerts | 4132 | .Fl clcerts , cacerts , |
3952 | or | 4133 | or |
3953 | .Fl nocerts | 4134 | .Fl nocerts |
3954 | options are present then all certificates will be output in the order | 4135 | options are present, then all certificates will be output in the order |
3955 | they appear in the input PKCS#12 files. | 4136 | they appear in the input PKCS#12 files. |
3956 | There is no guarantee that the first certificate present is | 4137 | There is no guarantee that the first certificate present is |
3957 | the one corresponding to the private key. | 4138 | the one corresponding to the private key. |
@@ -3962,7 +4143,7 @@ Using the | |||
3962 | .Fl clcerts | 4143 | .Fl clcerts |
3963 | option will solve this problem by only outputting the certificate | 4144 | option will solve this problem by only outputting the certificate |
3964 | corresponding to the private key. | 4145 | corresponding to the private key. |
3965 | If the CA certificates are required then they can be output to a separate | 4146 | If the CA certificates are required, then they can be output to a separate |
3966 | file using the | 4147 | file using the |
3967 | .Fl nokeys | 4148 | .Fl nokeys |
3968 | and | 4149 | and |
@@ -3975,40 +4156,40 @@ and | |||
3975 | .Fl certpbe | 4156 | .Fl certpbe |
3976 | algorithms allow the precise encryption algorithms for private keys | 4157 | algorithms allow the precise encryption algorithms for private keys |
3977 | and certificates to be specified. | 4158 | and certificates to be specified. |
3978 | Normally the defaults are fine but occasionally software can't handle | 4159 | Normally, the defaults are fine but occasionally software can't handle |
3979 | triple DES encrypted private keys; | 4160 | triple DES encrypted private keys; |
3980 | then the option | 4161 | then the option |
3981 | .Fl keypbe Ar PBE-SHA1-RC2-40 | 4162 | .Fl keypbe Ar PBE-SHA1-RC2-40 |
3982 | can be used to reduce the private key encryption to 40 bit RC2. | 4163 | can be used to reduce the private key encryption to 40-bit RC2. |
3983 | A complete description of all algorithms is contained in the | 4164 | A complete description of all algorithms is contained in the |
3984 | .Sx PKCS8 | 4165 | .Sx PKCS8 |
3985 | section above. | 4166 | section above. |
3986 | .Sh PKCS12 EXAMPLES | 4167 | .Sh PKCS12 EXAMPLES |
3987 | Parse a PKCS#12 file and output it to a file: | 4168 | Parse a PKCS#12 file and output it to a file: |
3988 | .Pp | 4169 | .Pp |
3989 | \& $ openssl pkcs12 -in file.p12 -out file.pem | 4170 | .Dl $ openssl pkcs12 -in file.p12 -out file.pem |
3990 | .Pp | 4171 | .Pp |
3991 | Output only client certificates to a file: | 4172 | Output only client certificates to a file: |
3992 | .Pp | 4173 | .Pp |
3993 | \& $ openssl pkcs12 -in file.p12 -clcerts -out file.pem | 4174 | .Dl $ openssl pkcs12 -in file.p12 -clcerts -out file.pem |
3994 | .Pp | 4175 | .Pp |
3995 | Don't encrypt the private key: | 4176 | Don't encrypt the private key: |
3996 | .Pp | 4177 | .Pp |
3997 | \& $ openssl pkcs12 -in file.p12 -out file.pem -nodes | 4178 | .Dl $ openssl pkcs12 -in file.p12 -out file.pem -nodes |
3998 | .Pp | 4179 | .Pp |
3999 | Print some info about a PKCS#12 file: | 4180 | Print some info about a PKCS#12 file: |
4000 | .Pp | 4181 | .Pp |
4001 | \& $ openssl pkcs12 -in file.p12 -info -noout | 4182 | .Dl $ openssl pkcs12 -in file.p12 -info -noout |
4002 | .Pp | 4183 | .Pp |
4003 | Create a PKCS#12 file: | 4184 | Create a PKCS#12 file: |
4004 | .Bd -literal | 4185 | .Bd -literal -offset indent |
4005 | \& $ openssl pkcs12 -export -in file.pem -out file.p12 \e | 4186 | $ openssl pkcs12 -export -in file.pem -out file.p12 \e |
4006 | -name "My Certificate" | 4187 | -name "My Certificate" |
4007 | .Ed | 4188 | .Ed |
4008 | .Pp | 4189 | .Pp |
4009 | Include some extra certificates: | 4190 | Include some extra certificates: |
4010 | .Bd -literal | 4191 | .Bd -literal -offset indent |
4011 | \& $ openssl pkcs12 -export -in file.pem -out file.p12 \e | 4192 | $ openssl pkcs12 -export -in file.pem -out file.p12 \e |
4012 | -name "My Certificate" -certfile othercerts.pem | 4193 | -name "My Certificate" -certfile othercerts.pem |
4013 | .Ed | 4194 | .Ed |
4014 | .Sh PKCS12 BUGS | 4195 | .Sh PKCS12 BUGS |
@@ -4020,8 +4201,9 @@ before 0.9.6a had a bug in the PKCS#12 key generation routines. | |||
4020 | Under rare circumstances this could produce a PKCS#12 file encrypted | 4201 | Under rare circumstances this could produce a PKCS#12 file encrypted |
4021 | with an invalid key. | 4202 | with an invalid key. |
4022 | As a result some PKCS#12 files which triggered this bug | 4203 | As a result some PKCS#12 files which triggered this bug |
4023 | from other implementations (MSIE or Netscape) could not be decrypted | 4204 | from other implementations |
4024 | by | 4205 | .Pq MSIE or Netscape |
4206 | could not be decrypted by | ||
4025 | .Nm OpenSSL | 4207 | .Nm OpenSSL |
4026 | and similarly | 4208 | and similarly |
4027 | .Nm OpenSSL | 4209 | .Nm OpenSSL |
@@ -4043,9 +4225,10 @@ and recreating | |||
4043 | the PKCS#12 file from the keys and certificates using a newer version of | 4225 | the PKCS#12 file from the keys and certificates using a newer version of |
4044 | .Nm OpenSSL . | 4226 | .Nm OpenSSL . |
4045 | For example: | 4227 | For example: |
4046 | .Bd -literal | 4228 | .Bd -literal -offset indent |
4047 | \& $ old-openssl -in bad.p12 -out keycerts.pem | 4229 | $ old-openssl -in bad.p12 -out keycerts.pem |
4048 | \& $ openssl -in keycerts.pem -export -name "My PKCS#12 file" -out fixed.p12 | 4230 | $ openssl -in keycerts.pem -export -name "My PKCS#12 file" \e |
4231 | -out fixed.p12 | ||
4049 | .Ed | 4232 | .Ed |
4050 | .\" | 4233 | .\" |
4051 | .\" RAND | 4234 | .\" RAND |
@@ -4053,8 +4236,9 @@ For example: | |||
4053 | .Sh RAND | 4236 | .Sh RAND |
4054 | .Cm openssl rand | 4237 | .Cm openssl rand |
4055 | .Op Fl out Ar file | 4238 | .Op Fl out Ar file |
4056 | .Op Fl rand Ar file | 4239 | .Op Fl rand Ar file ... |
4057 | .Op Fl base64 | 4240 | .Op Fl base64 |
4241 | .Op Fl engine Ar id | ||
4058 | .Ar num | 4242 | .Ar num |
4059 | .Pp | 4243 | .Pp |
4060 | The | 4244 | The |
@@ -4086,25 +4270,23 @@ Write to | |||
4086 | .Ar file | 4270 | .Ar file |
4087 | instead of standard output. | 4271 | instead of standard output. |
4088 | .It Fl rand Ar file ... | 4272 | .It Fl rand Ar file ... |
4089 | Use specified | 4273 | Use specified file or files, or EGD socket (see |
4090 | .Ar file | ||
4091 | or | ||
4092 | .Ar file Ns Li s | ||
4093 | or EGD socket (see | ||
4094 | .Xr RAND_egd 3 ) | 4274 | .Xr RAND_egd 3 ) |
4095 | for seeding the random number generator. | 4275 | for seeding the random number generator. |
4096 | Multiple files can be specified separated by an OS-dependent character. | 4276 | Multiple files can be specified separated by a |
4097 | The separator is | 4277 | .Sq \&: . |
4098 | .Cm \&; | ||
4099 | for MS-Windows, | ||
4100 | .Cm \&, | ||
4101 | for OpenVMS, and | ||
4102 | .Cm \&: | ||
4103 | for all others. | ||
4104 | .It Fl base64 | 4278 | .It Fl base64 |
4105 | Perform | 4279 | Perform |
4106 | .Em base64 | 4280 | .Em base64 |
4107 | encoding on the output. | 4281 | encoding on the output. |
4282 | .It Fl engine Ar id | ||
4283 | Specifying an engine (by it's unique | ||
4284 | .Ar id | ||
4285 | string) will cause | ||
4286 | .Nm rand | ||
4287 | to attempt to obtain a functional reference to the specified engine, | ||
4288 | thus initialising it if needed. | ||
4289 | The engine will then be set as the default for all available algorithms. | ||
4108 | .El | 4290 | .El |
4109 | .\" | 4291 | .\" |
4110 | .\" REQ | 4292 | .\" REQ |
@@ -4112,8 +4294,8 @@ encoding on the output. | |||
4112 | .Sh REQ | 4294 | .Sh REQ |
4113 | .Nm openssl req | 4295 | .Nm openssl req |
4114 | .Bk -words | 4296 | .Bk -words |
4115 | .Op Fl inform Ar PEM|DER | 4297 | .Op Fl inform Ar DER | PEM |
4116 | .Op Fl outform Ar PEM|DER | 4298 | .Op Fl outform Ar DER | PEM |
4117 | .Op Fl in Ar filename | 4299 | .Op Fl in Ar filename |
4118 | .Op Fl passin Ar arg | 4300 | .Op Fl passin Ar arg |
4119 | .Op Fl out Ar filename | 4301 | .Op Fl out Ar filename |
@@ -4125,13 +4307,22 @@ encoding on the output. | |||
4125 | .Op Fl modulus | 4307 | .Op Fl modulus |
4126 | .Op Fl new | 4308 | .Op Fl new |
4127 | .Op Fl rand Ar file ... | 4309 | .Op Fl rand Ar file ... |
4128 | .Op Fl newkey Ar rsa:bits | 4310 | .Oo Xo |
4129 | .Op Fl newkey Ar dsa:file | 4311 | .Fl newkey |
4312 | .Ar rsa Ns : Ns Ar bits | ||
4313 | .Xc | ||
4314 | .Oc | ||
4315 | .Oo Xo | ||
4316 | .Fl newkey | ||
4317 | .Ar dsa Ns : Ns Ar file | ||
4318 | .Xc | ||
4319 | .Oc | ||
4130 | .Op Fl nodes | 4320 | .Op Fl nodes |
4321 | .Op Fl subject | ||
4131 | .Op Fl key Ar filename | 4322 | .Op Fl key Ar filename |
4132 | .Op Fl keyform Ar PEM|DER | 4323 | .Op Fl keyform Ar DER | PEM |
4133 | .Op Fl keyout Ar filename | 4324 | .Op Fl keyout Ar filename |
4134 | .Op Fl Op Cm md5|sha1|md2|mdc2 | 4325 | .Op Fl md5 | sha1 | md2 | md4 |
4135 | .Op Fl config Ar filename | 4326 | .Op Fl config Ar filename |
4136 | .Op Fl subj Ar arg | 4327 | .Op Fl subj Ar arg |
4137 | .Op Fl x509 | 4328 | .Op Fl x509 |
@@ -4157,7 +4348,7 @@ for use as root CAs, for example. | |||
4157 | .Pp | 4348 | .Pp |
4158 | The options are as follows: | 4349 | The options are as follows: |
4159 | .Bl -tag -width "XXXX" | 4350 | .Bl -tag -width "XXXX" |
4160 | .It Fl inform Ar DER|PEM | 4351 | .It Fl inform Ar DER | PEM |
4161 | This specifies the input format. | 4352 | This specifies the input format. |
4162 | The | 4353 | The |
4163 | .Ar DER | 4354 | .Ar DER |
@@ -4168,8 +4359,8 @@ The | |||
4168 | form is the default format: | 4359 | form is the default format: |
4169 | it consists of the DER format base64 encoded with additional header and | 4360 | it consists of the DER format base64 encoded with additional header and |
4170 | footer lines. | 4361 | footer lines. |
4171 | .It Fl outform Ar DER|PEM | 4362 | .It Fl outform Ar DER | PEM |
4172 | This specifies the output format, the options have the same meaning as the | 4363 | This specifies the output format; the options have the same meaning as the |
4173 | .Fl inform | 4364 | .Fl inform |
4174 | option. | 4365 | option. |
4175 | .It Fl in Ar filename | 4366 | .It Fl in Ar filename |
@@ -4185,7 +4376,7 @@ are not specified. | |||
4185 | .It Fl passin Ar arg | 4376 | .It Fl passin Ar arg |
4186 | The input file password source. | 4377 | The input file password source. |
4187 | For more information about the format of | 4378 | For more information about the format of |
4188 | .Ar arg | 4379 | .Ar arg , |
4189 | see the | 4380 | see the |
4190 | .Sx PASS PHRASE ARGUMENTS | 4381 | .Sx PASS PHRASE ARGUMENTS |
4191 | section above. | 4382 | section above. |
@@ -4196,7 +4387,7 @@ to write to, or standard output by default. | |||
4196 | .It Fl passout Ar arg | 4387 | .It Fl passout Ar arg |
4197 | The output file password source. | 4388 | The output file password source. |
4198 | For more information about the format of | 4389 | For more information about the format of |
4199 | .Ar arg | 4390 | .Ar arg , |
4200 | see the | 4391 | see the |
4201 | .Sx PASS PHRASE ARGUMENTS | 4392 | .Sx PASS PHRASE ARGUMENTS |
4202 | section above. | 4393 | section above. |
@@ -4219,34 +4410,24 @@ are specified in the configuration file and any requested extensions. | |||
4219 | .Pp | 4410 | .Pp |
4220 | If the | 4411 | If the |
4221 | .Fl key | 4412 | .Fl key |
4222 | option is not used it will generate a new RSA private | 4413 | option is not used, it will generate a new RSA private |
4223 | key using information specified in the configuration file. | 4414 | key using information specified in the configuration file. |
4224 | .It Fl rand Ar file ... | 4415 | .It Fl rand Ar file ... |
4225 | A | 4416 | A file or files containing random data used to seed the random number generator, |
4226 | .Ar file | ||
4227 | or | ||
4228 | .Ar file Ns Li s | ||
4229 | containing random data used to seed the random number generator, | ||
4230 | or an EGD socket (see | 4417 | or an EGD socket (see |
4231 | .Xr RAND_egd 3 ) . | 4418 | .Xr RAND_egd 3 ) . |
4232 | Multiple files can be specified separated by an OS-dependent character. | 4419 | Multiple files can be specified separated by a |
4233 | The separator is | 4420 | .Sq \&: . |
4234 | .Cm \&; | ||
4235 | for MS-Windows, | ||
4236 | .Cm \&, | ||
4237 | for OpenVMS, and | ||
4238 | .Cm \&: | ||
4239 | for all others. | ||
4240 | .It Fl newkey Ar arg | 4421 | .It Fl newkey Ar arg |
4241 | This option creates a new certificate request and a new private key. | 4422 | This option creates a new certificate request and a new private key. |
4242 | The argument takes one of two forms: | 4423 | The argument takes one of two forms: |
4243 | .Ar rsa:nbits , | 4424 | .Ar rsa Ns : Ns Ar nbits , |
4244 | where | 4425 | where |
4245 | .Ar nbits | 4426 | .Ar nbits |
4246 | is the number of bits, generates an RSA key | 4427 | is the number of bits, generates an RSA key |
4247 | .Ar nbits | 4428 | .Ar nbits |
4248 | in size. | 4429 | in size. |
4249 | .Ar dsa:filename | 4430 | .Ar dsa Ns : Ns Ar filename |
4250 | generates a DSA key using the parameters in the file | 4431 | generates a DSA key using the parameters in the file |
4251 | .Ar filename . | 4432 | .Ar filename . |
4252 | .It Fl key Ar filename | 4433 | .It Fl key Ar filename |
@@ -4254,11 +4435,11 @@ This specifies the file to read the private key from. | |||
4254 | It also accepts PKCS#8 format private keys for | 4435 | It also accepts PKCS#8 format private keys for |
4255 | .Em PEM | 4436 | .Em PEM |
4256 | format files. | 4437 | format files. |
4257 | .It Fl keyform Ar PEM|DER | 4438 | .It Fl keyform Ar DER | PEM |
4258 | The format of the private key file specified in the | 4439 | The format of the private key file specified in the |
4259 | .Fl key | 4440 | .Fl key |
4260 | argument. | 4441 | argument. |
4261 | .AR PEM | 4442 | .Ar PEM |
4262 | is the default. | 4443 | is the default. |
4263 | .It Fl keyout Ar filename | 4444 | .It Fl keyout Ar filename |
4264 | This gives the | 4445 | This gives the |
@@ -4267,9 +4448,11 @@ to write the newly created private key to. | |||
4267 | If this option is not specified, then the filename present in the | 4448 | If this option is not specified, then the filename present in the |
4268 | configuration file is used. | 4449 | configuration file is used. |
4269 | .It Fl nodes | 4450 | .It Fl nodes |
4270 | If this option is specified then if a private key is created it | 4451 | If this option is specified and a private key is created, it |
4271 | will not be encrypted. | 4452 | will not be encrypted. |
4272 | .It Fl md5|sha1|md2|mdc2 | 4453 | .It Fl subject |
4454 | Output the request's subject. | ||
4455 | .It Fl md5 | sha1 | md2 | md4 | ||
4273 | This specifies the message digest to sign the request with. | 4456 | This specifies the message digest to sign the request with. |
4274 | This overrides the digest algorithm specified in the configuration file. | 4457 | This overrides the digest algorithm specified in the configuration file. |
4275 | This option is ignored for DSA requests: they always use SHA1. | 4458 | This option is ignored for DSA requests: they always use SHA1. |
@@ -4277,34 +4460,38 @@ This option is ignored for DSA requests: they always use SHA1. | |||
4277 | This allows an alternative configuration file to be specified; | 4460 | This allows an alternative configuration file to be specified; |
4278 | this overrides the compile time filename or any specified in | 4461 | this overrides the compile time filename or any specified in |
4279 | the | 4462 | the |
4280 | .Em OPENSSL_CONF | 4463 | .Ev OPENSSL_CONF |
4281 | environment variable. | 4464 | environment variable. |
4282 | .It Fl subj Ar arg | 4465 | .It Fl subj Ar arg |
4283 | Sets subject name for new request or supersedes the subject name | 4466 | Sets subject name for new request or supersedes the subject name |
4284 | when processing a request. | 4467 | when processing a request. |
4285 | The arg must be formatted as | 4468 | The arg must be formatted as |
4286 | .Em /type0=value0/type1=value1/type2=... , | 4469 | .Em /type0=value0/type1=value1/type2=... ; |
4287 | characters may be escaped by \e (backslash), no spaces are skipped. | 4470 | characters may be escaped by |
4471 | .Sq \e | ||
4472 | .Pq backslash , | ||
4473 | no spaces are skipped. | ||
4288 | .It Fl x509 | 4474 | .It Fl x509 |
4289 | This option outputs a self-signed certificate instead of a certificate | 4475 | This option outputs a self-signed certificate instead of a certificate |
4290 | request. | 4476 | request. |
4291 | This is typically used to generate a test certificate or | 4477 | This is typically used to generate a test certificate or |
4292 | a self-signed root CA. | 4478 | a self-signed root CA. |
4293 | The extensions added to the certificate | 4479 | The extensions added to the certificate |
4294 | (if any) are specified in the configuration file. | 4480 | .Pq if any |
4481 | are specified in the configuration file. | ||
4295 | Unless specified using the | 4482 | Unless specified using the |
4296 | .Fl set_serial | 4483 | .Fl set_serial |
4297 | option, 0 will be used for the serial number. | 4484 | option, 0 will be used for the serial number. |
4298 | .It Fl days Ar n | 4485 | .It Fl days Ar n |
4299 | When the | 4486 | When the |
4300 | .Fl x509 | 4487 | .Fl x509 |
4301 | option is being used this specifies the number of | 4488 | option is being used, this specifies the number of |
4302 | days to certify the certificate for. | 4489 | days to certify the certificate for. |
4303 | The default is 30 days. | 4490 | The default is 30 days. |
4304 | .It Fl set_serial Ar n | 4491 | .It Fl set_serial Ar n |
4305 | Serial number to use when outputting a self-signed certificate. | 4492 | Serial number to use when outputting a self-signed certificate. |
4306 | This may be specified as a decimal value or a hex value if preceded by | 4493 | This may be specified as a decimal value or a hex value if preceded by |
4307 | .Em 0x . | 4494 | .Sq 0x . |
4308 | It is possible to use negative serial numbers but this is not recommended. | 4495 | It is possible to use negative serial numbers but this is not recommended. |
4309 | .It Fl extensions Ar section , Fl reqexts Ar section | 4496 | .It Fl extensions Ar section , Fl reqexts Ar section |
4310 | These options specify alternative sections to include certificate | 4497 | These options specify alternative sections to include certificate |
@@ -4315,8 +4502,8 @@ This allows several different sections to | |||
4315 | be used in the same configuration file to specify requests for | 4502 | be used in the same configuration file to specify requests for |
4316 | a variety of purposes. | 4503 | a variety of purposes. |
4317 | .It Fl utf8 | 4504 | .It Fl utf8 |
4318 | This option causes field values to be interpreted as UTF8 strings, by | 4505 | This option causes field values to be interpreted as UTF8 strings; |
4319 | default they are interpreted as ASCII. | 4506 | by default they are interpreted as ASCII. |
4320 | This means that the field values, whether prompted from a terminal or | 4507 | This means that the field values, whether prompted from a terminal or |
4321 | obtained from a configuration file, must be valid UTF8 strings. | 4508 | obtained from a configuration file, must be valid UTF8 strings. |
4322 | .It Fl nameopt Ar option | 4509 | .It Fl nameopt Ar option |
@@ -4331,7 +4518,7 @@ See the | |||
4331 | .Sx X509 | 4518 | .Sx X509 |
4332 | section below for details. | 4519 | section below for details. |
4333 | .It Fl asn1-kludge | 4520 | .It Fl asn1-kludge |
4334 | By default the | 4521 | By default, the |
4335 | .Nm req | 4522 | .Nm req |
4336 | command outputs certificate requests containing | 4523 | command outputs certificate requests containing |
4337 | no attributes in the correct PKCS#10 format. | 4524 | no attributes in the correct PKCS#10 format. |
@@ -4339,7 +4526,7 @@ However certain CAs will only | |||
4339 | accept requests containing no attributes in an invalid form: this | 4526 | accept requests containing no attributes in an invalid form: this |
4340 | option produces this invalid format. | 4527 | option produces this invalid format. |
4341 | .Pp | 4528 | .Pp |
4342 | More precisely the | 4529 | More precisely, the |
4343 | .Em Attributes | 4530 | .Em Attributes |
4344 | in a PKCS#10 certificate request are defined as a SET OF Attribute. | 4531 | in a PKCS#10 certificate request are defined as a SET OF Attribute. |
4345 | They are | 4532 | They are |
@@ -4354,7 +4541,9 @@ It should be noted that very few CAs still require the use of this option. | |||
4354 | Adds the word NEW to the | 4541 | Adds the word NEW to the |
4355 | .Em PEM | 4542 | .Em PEM |
4356 | file header and footer lines on the outputed request. | 4543 | file header and footer lines on the outputed request. |
4357 | Some software (Netscape certificate server) and some CAs need this. | 4544 | Some software |
4545 | .Pq Netscape certificate server | ||
4546 | and some CAs need this. | ||
4358 | .It Fl batch | 4547 | .It Fl batch |
4359 | Non-interactive mode. | 4548 | Non-interactive mode. |
4360 | .It Fl verbose | 4549 | .It Fl verbose |
@@ -4373,7 +4562,7 @@ The configuration options are specified in the | |||
4373 | .Em req | 4562 | .Em req |
4374 | section of the configuration file. | 4563 | section of the configuration file. |
4375 | As with all configuration files, if no value is specified in the specific | 4564 | As with all configuration files, if no value is specified in the specific |
4376 | section (i.e. | 4565 | section (i.e.\& |
4377 | .Em req ) | 4566 | .Em req ) |
4378 | then the initial unnamed or | 4567 | then the initial unnamed or |
4379 | .Em default | 4568 | .Em default |
@@ -4381,9 +4570,11 @@ section is searched too. | |||
4381 | .Pp | 4570 | .Pp |
4382 | The options available are described in detail below. | 4571 | The options available are described in detail below. |
4383 | .Bl -tag -width "XXXX" | 4572 | .Bl -tag -width "XXXX" |
4384 | .It Ar input_password output_password | 4573 | .It Ar input_password | output_password |
4385 | The passwords for the input private key file (if present) and | 4574 | The passwords for the input private key file |
4386 | the output private key file (if one will be created). | 4575 | .Pq if present |
4576 | and the output private key file | ||
4577 | .Pq if one will be created . | ||
4387 | The command line options | 4578 | The command line options |
4388 | .Fl passin | 4579 | .Fl passin |
4389 | and | 4580 | and |
@@ -4414,7 +4605,7 @@ This specifies a section in the configuration file containing extra | |||
4414 | object identifiers. | 4605 | object identifiers. |
4415 | Each line should consist of the short name of the | 4606 | Each line should consist of the short name of the |
4416 | object identifier followed by | 4607 | object identifier followed by |
4417 | .Cm = | 4608 | .Sq = |
4418 | and the numerical form. | 4609 | and the numerical form. |
4419 | The short and long names are the same when this option is used. | 4610 | The short and long names are the same when this option is used. |
4420 | .It Ar RANDFILE | 4611 | .It Ar RANDFILE |
@@ -4425,7 +4616,7 @@ It is used for private key generation. | |||
4425 | .It Ar encrypt_key | 4616 | .It Ar encrypt_key |
4426 | If this is set to | 4617 | If this is set to |
4427 | .Em no | 4618 | .Em no |
4428 | then if a private key is generated it is | 4619 | and a private key is generated, it is |
4429 | .Em not | 4620 | .Em not |
4430 | encrypted. | 4621 | encrypted. |
4431 | This is equivalent to the | 4622 | This is equivalent to the |
@@ -4437,10 +4628,10 @@ is an equivalent option. | |||
4437 | .It Ar default_md | 4628 | .It Ar default_md |
4438 | This option specifies the digest algorithm to use. | 4629 | This option specifies the digest algorithm to use. |
4439 | Possible values include | 4630 | Possible values include |
4440 | .Ar md5 , sha1 | 4631 | .Ar md5 |
4441 | and | 4632 | and |
4442 | .Ar mdc2 . | 4633 | .Ar sha1 . |
4443 | If not present then MD5 is used. | 4634 | If not present, then MD5 is used. |
4444 | This option can be overridden on the command line. | 4635 | This option can be overridden on the command line. |
4445 | .It Ar string_mask | 4636 | .It Ar string_mask |
4446 | This option masks out the use of certain string types in certain | 4637 | This option masks out the use of certain string types in certain |
@@ -4455,7 +4646,7 @@ and | |||
4455 | .Em BMPStrings ; | 4646 | .Em BMPStrings ; |
4456 | if the | 4647 | if the |
4457 | .Ar pkix | 4648 | .Ar pkix |
4458 | value is used then only | 4649 | value is used, then only |
4459 | .Em PrintableStrings | 4650 | .Em PrintableStrings |
4460 | and | 4651 | and |
4461 | .Em BMPStrings | 4652 | .Em BMPStrings |
@@ -4463,7 +4654,7 @@ will be used. | |||
4463 | This follows the PKIX recommendation in RFC 2459. | 4654 | This follows the PKIX recommendation in RFC 2459. |
4464 | If the | 4655 | If the |
4465 | .Fl utf8only | 4656 | .Fl utf8only |
4466 | option is used then only | 4657 | option is used, then only |
4467 | .Em UTF8Strings | 4658 | .Em UTF8Strings |
4468 | will be used: this is the PKIX recommendation in RFC 2459 after 2003. | 4659 | will be used: this is the PKIX recommendation in RFC 2459 after 2003. |
4469 | Finally, the | 4660 | Finally, the |
@@ -4531,16 +4722,18 @@ sections. | |||
4531 | If the | 4722 | If the |
4532 | .Fl prompt | 4723 | .Fl prompt |
4533 | option is set to | 4724 | option is set to |
4534 | .Em no | 4725 | .Em no , |
4535 | then these sections just consist of field names and values: for example, | 4726 | then these sections just consist of field names and values: for example, |
4536 | .Bd -literal | 4727 | .Bd -unfilled -offset indent |
4537 | \& CN=My Name | 4728 | CN=My Name |
4538 | \& OU=My Organization | 4729 | OU=My Organization |
4539 | \& emailAddress=someone@somewhere.org | 4730 | emailAddress=someone@somewhere.org |
4540 | .Ed | 4731 | .Ed |
4541 | .Pp | 4732 | .Pp |
4542 | This allows external programs (e.g. GUI based) to generate a template file | 4733 | This allows external programs |
4543 | with all the field names and values and just pass it to | 4734 | .Pq e.g. GUI based |
4735 | to generate a template file with all the field names and values | ||
4736 | and just pass it to | ||
4544 | .Nm req . | 4737 | .Nm req . |
4545 | An example of this kind of configuration file is contained in the | 4738 | An example of this kind of configuration file is contained in the |
4546 | .Sx REQ EXAMPLES | 4739 | .Sx REQ EXAMPLES |
@@ -4552,21 +4745,26 @@ option is absent or not set to | |||
4552 | .Em no , | 4745 | .Em no , |
4553 | then the file contains field prompting information. | 4746 | then the file contains field prompting information. |
4554 | It consists of lines of the form: | 4747 | It consists of lines of the form: |
4555 | .Bd -literal | 4748 | .Bd -unfilled -offset indent |
4556 | \& fieldName="prompt" | 4749 | fieldName="prompt" |
4557 | \& fieldName_default="default field value" | 4750 | fieldName_default="default field value" |
4558 | \& fieldName_min= 2 | 4751 | fieldName_min= 2 |
4559 | \& fieldName_max= 4 | 4752 | fieldName_max= 4 |
4560 | .Ed | 4753 | .Ed |
4561 | .Pp | 4754 | .Pp |
4562 | "fieldName" is the field name being used, for example | 4755 | .Qq fieldName |
4756 | is the field name being used, for example | ||
4563 | .Em commonName | 4757 | .Em commonName |
4564 | (or CN). | 4758 | .Pq or CN . |
4565 | The "prompt" string is used to ask the user to enter the relevant details. | 4759 | The |
4760 | .Qq prompt | ||
4761 | string is used to ask the user to enter the relevant details. | ||
4566 | If the user enters nothing, then the default value is used; | 4762 | If the user enters nothing, then the default value is used; |
4567 | if no default value is present then the field is omitted. | 4763 | if no default value is present, then the field is omitted. |
4568 | A field can still be omitted if a default value is present, | 4764 | A field can still be omitted if a default value is present, |
4569 | if the user just enters the '.' character. | 4765 | if the user just enters the |
4766 | .Sq \&. | ||
4767 | character. | ||
4570 | .Pp | 4768 | .Pp |
4571 | The number of characters entered must be between the | 4769 | The number of characters entered must be between the |
4572 | .Em fieldName_min | 4770 | .Em fieldName_min |
@@ -4584,12 +4782,13 @@ Some fields (such as | |||
4584 | can be used more than once in a DN. | 4782 | can be used more than once in a DN. |
4585 | This presents a problem because configuration files will | 4783 | This presents a problem because configuration files will |
4586 | not recognize the same name occurring twice. | 4784 | not recognize the same name occurring twice. |
4587 | To avoid this problem if the | 4785 | To avoid this problem, if the |
4588 | .Em fieldName | 4786 | .Em fieldName |
4589 | contains some characters followed by a full stop they will be ignored. | 4787 | contains some characters followed by a full stop, they will be ignored. |
4590 | So, for example, a second | 4788 | So, for example, a second |
4591 | .Em organizationName | 4789 | .Em organizationName |
4592 | can be input by calling it "1.organizationName". | 4790 | can be input by calling it |
4791 | .Qq 1.organizationName . | ||
4593 | .Pp | 4792 | .Pp |
4594 | The actual permitted field names are any object identifier short or | 4793 | The actual permitted field names are any object identifier short or |
4595 | long names. | 4794 | long names. |
@@ -4598,7 +4797,7 @@ These are compiled into | |||
4598 | and include the usual values such as | 4797 | and include the usual values such as |
4599 | .Em commonName , countryName , localityName , organizationName , | 4798 | .Em commonName , countryName , localityName , organizationName , |
4600 | .Em organizationUnitName , stateOrProvinceName . | 4799 | .Em organizationUnitName , stateOrProvinceName . |
4601 | Additionally | 4800 | Additionally, |
4602 | .Em emailAddress | 4801 | .Em emailAddress |
4603 | is included as well as | 4802 | is included as well as |
4604 | .Em name , surname , givenName initials | 4803 | .Em name , surname , givenName initials |
@@ -4615,36 +4814,36 @@ Any additional fields will be treated as though they were a | |||
4615 | .Sh REQ EXAMPLES | 4814 | .Sh REQ EXAMPLES |
4616 | Examine and verify certificate request: | 4815 | Examine and verify certificate request: |
4617 | .Pp | 4816 | .Pp |
4618 | \& $ openssl req -in req.pem -text -verify -noout | 4817 | .Dl $ openssl req -in req.pem -text -verify -noout |
4619 | .Pp | 4818 | .Pp |
4620 | Create a private key and then generate a certificate request from it: | 4819 | Create a private key and then generate a certificate request from it: |
4621 | .Bd -literal | 4820 | .Bd -literal -offset indent |
4622 | \& $ openssl genrsa -out key.pem 1024 | 4821 | $ openssl genrsa -out key.pem 1024 |
4623 | \& $ openssl req -new -key key.pem -out req.pem | 4822 | $ openssl req -new -key key.pem -out req.pem |
4624 | .Ed | 4823 | .Ed |
4625 | .Pp | 4824 | .Pp |
4626 | The same but just using req: | 4825 | The same but just using req: |
4627 | .Pp | 4826 | .Pp |
4628 | \& $ openssl req -newkey rsa:1024 -keyout key.pem -out req.pem | 4827 | .Dl $ openssl req -newkey rsa:1024 -keyout key.pem -out req.pem |
4629 | .Pp | 4828 | .Pp |
4630 | Generate a self-signed root certificate: | 4829 | Generate a self-signed root certificate: |
4631 | .Pp | 4830 | .Pp |
4632 | \& $ openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem | 4831 | .Dl "$ openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem" |
4633 | .Pp | 4832 | .Pp |
4634 | Example of a file pointed to by the | 4833 | Example of a file pointed to by the |
4635 | .Ar oid_file | 4834 | .Ar oid_file |
4636 | option: | 4835 | option: |
4637 | .Bd -literal | 4836 | .Bd -unfilled -offset indent |
4638 | \& 1.2.3.4 shortName A longer Name | 4837 | 1.2.3.4 shortName A longer Name |
4639 | \& 1.2.3.6 otherName Other longer Name | 4838 | 1.2.3.6 otherName Other longer Name |
4640 | .Ed | 4839 | .Ed |
4641 | .Pp | 4840 | .Pp |
4642 | Example of a section pointed to by | 4841 | Example of a section pointed to by |
4643 | .Ar oid_section | 4842 | .Ar oid_section |
4644 | making use of variable expansion: | 4843 | making use of variable expansion: |
4645 | .Bd -literal | 4844 | .Bd -unfilled -offset indent |
4646 | \& testoid1=1.2.3.5 | 4845 | testoid1=1.2.3.5 |
4647 | \& testoid2=${testoid1}.6 | 4846 | testoid2=${testoid1}.6 |
4648 | .Ed | 4847 | .Ed |
4649 | .Pp | 4848 | .Pp |
4650 | Sample configuration file prompting for field values: | 4849 | Sample configuration file prompting for field values: |
@@ -4655,32 +4854,32 @@ Sample configuration file prompting for field values: | |||
4655 | \& distinguished_name = req_distinguished_name | 4854 | \& distinguished_name = req_distinguished_name |
4656 | \& attributes = req_attributes | 4855 | \& attributes = req_attributes |
4657 | \& x509_extensions = v3_ca | 4856 | \& x509_extensions = v3_ca |
4658 | .Pp | 4857 | |
4659 | \& dirstring_type = nobmp | 4858 | \& dirstring_type = nobmp |
4660 | .Pp | 4859 | |
4661 | \& [ req_distinguished_name ] | 4860 | \& [ req_distinguished_name ] |
4662 | \& countryName = Country Name (2 letter code) | 4861 | \& countryName = Country Name (2 letter code) |
4663 | \& countryName_default = AU | 4862 | \& countryName_default = AU |
4664 | \& countryName_min = 2 | 4863 | \& countryName_min = 2 |
4665 | \& countryName_max = 2 | 4864 | \& countryName_max = 2 |
4666 | .Pp | 4865 | |
4667 | \& localityName = Locality Name (eg, city) | 4866 | \& localityName = Locality Name (eg, city) |
4668 | .Pp | 4867 | |
4669 | \& organizationalUnitName = Organizational Unit Name (eg, section) | 4868 | \& organizationalUnitName = Organizational Unit Name (eg, section) |
4670 | .Pp | 4869 | |
4671 | \& commonName = Common Name (eg, YOUR name) | 4870 | \& commonName = Common Name (eg, YOUR name) |
4672 | \& commonName_max = 64 | 4871 | \& commonName_max = 64 |
4673 | .Pp | 4872 | |
4674 | \& emailAddress = Email Address | 4873 | \& emailAddress = Email Address |
4675 | \& emailAddress_max = 40 | 4874 | \& emailAddress_max = 40 |
4676 | .Pp | 4875 | |
4677 | \& [ req_attributes ] | 4876 | \& [ req_attributes ] |
4678 | \& challengePassword = A challenge password | 4877 | \& challengePassword = A challenge password |
4679 | \& challengePassword_min = 4 | 4878 | \& challengePassword_min = 4 |
4680 | \& challengePassword_max = 20 | 4879 | \& challengePassword_max = 20 |
4681 | .Pp | 4880 | |
4682 | \& [ v3_ca ] | 4881 | \& [ v3_ca ] |
4683 | .Pp | 4882 | |
4684 | \& subjectKeyIdentifier=hash | 4883 | \& subjectKeyIdentifier=hash |
4685 | \& authorityKeyIdentifier=keyid:always,issuer:always | 4884 | \& authorityKeyIdentifier=keyid:always,issuer:always |
4686 | \& basicConstraints = CA:true | 4885 | \& basicConstraints = CA:true |
@@ -4689,7 +4888,7 @@ Sample configuration file prompting for field values: | |||
4689 | Sample configuration containing all field values: | 4888 | Sample configuration containing all field values: |
4690 | .Bd -literal | 4889 | .Bd -literal |
4691 | \& RANDFILE = $ENV::HOME/.rnd | 4890 | \& RANDFILE = $ENV::HOME/.rnd |
4692 | .Pp | 4891 | |
4693 | \& [ req ] | 4892 | \& [ req ] |
4694 | \& default_bits = 1024 | 4893 | \& default_bits = 1024 |
4695 | \& default_keyfile = keyfile.pem | 4894 | \& default_keyfile = keyfile.pem |
@@ -4697,7 +4896,7 @@ Sample configuration containing all field values: | |||
4697 | \& attributes = req_attributes | 4896 | \& attributes = req_attributes |
4698 | \& prompt = no | 4897 | \& prompt = no |
4699 | \& output_password = mypass | 4898 | \& output_password = mypass |
4700 | .Pp | 4899 | |
4701 | \& [ req_distinguished_name ] | 4900 | \& [ req_distinguished_name ] |
4702 | \& C = GB | 4901 | \& C = GB |
4703 | \& ST = Test State or Province | 4902 | \& ST = Test State or Province |
@@ -4706,7 +4905,7 @@ Sample configuration containing all field values: | |||
4706 | \& OU = Organizational Unit Name | 4905 | \& OU = Organizational Unit Name |
4707 | \& CN = Common Name | 4906 | \& CN = Common Name |
4708 | \& emailAddress = test@email.address | 4907 | \& emailAddress = test@email.address |
4709 | .Pp | 4908 | |
4710 | \& [ req_attributes ] | 4909 | \& [ req_attributes ] |
4711 | \& challengePassword = A challenge password | 4910 | \& challengePassword = A challenge password |
4712 | .Ed | 4911 | .Ed |
@@ -4714,15 +4913,17 @@ Sample configuration containing all field values: | |||
4714 | The header and footer lines in the | 4913 | The header and footer lines in the |
4715 | .Ar PEM | 4914 | .Ar PEM |
4716 | format are normally: | 4915 | format are normally: |
4717 | .Bd -literal | 4916 | .Bd -unfilled -offset indent |
4718 | \& -----BEGIN CERTIFICATE REQUEST----- | 4917 | -----BEGIN CERTIFICATE REQUEST----- |
4719 | \& -----END CERTIFICATE REQUEST----- | 4918 | -----END CERTIFICATE REQUEST----- |
4720 | .Ed | 4919 | .Ed |
4721 | .Pp | 4920 | .Pp |
4722 | Some software (some versions of Netscape certificate server) instead needs: | 4921 | Some software |
4723 | .Bd -literal | 4922 | .Pq some versions of Netscape certificate server |
4724 | \& -----BEGIN NEW CERTIFICATE REQUEST----- | 4923 | instead needs: |
4725 | \& -----END NEW CERTIFICATE REQUEST----- | 4924 | .Bd -unfilled -offset indent |
4925 | -----BEGIN NEW CERTIFICATE REQUEST----- | ||
4926 | -----END NEW CERTIFICATE REQUEST----- | ||
4726 | .Ed | 4927 | .Ed |
4727 | .Pp | 4928 | .Pp |
4728 | which is produced with the | 4929 | which is produced with the |
@@ -4733,69 +4934,73 @@ Either form is accepted transparently on input. | |||
4733 | The certificate requests generated by Xenroll with MSIE have extensions added. | 4934 | The certificate requests generated by Xenroll with MSIE have extensions added. |
4734 | It includes the | 4935 | It includes the |
4735 | .Em keyUsage | 4936 | .Em keyUsage |
4736 | extension which determines the type of | 4937 | extension which determines the type of key |
4737 | key (signature only or general purpose) and any additional OIDs entered | 4938 | .Pq signature only or general purpose |
4738 | by the script in an | 4939 | and any additional OIDs entered by the script in an |
4739 | .Em extendedKeyUsage | 4940 | .Em extendedKeyUsage |
4740 | extension. | 4941 | extension. |
4741 | .Sh REQ DIAGNOSTICS | 4942 | .Sh REQ DIAGNOSTICS |
4742 | The following messages are frequently asked about: | 4943 | The following messages are frequently asked about: |
4743 | .Bd -literal | 4944 | .Bd -unfilled -offset indent |
4744 | \& Using configuration from /some/path/openssl.cnf | 4945 | Using configuration from /some/path/openssl.cnf |
4745 | \& Unable to load config info | 4946 | Unable to load config info |
4746 | .Ed | 4947 | .Ed |
4747 | .Pp | 4948 | .Pp |
4748 | This is followed some time later by... | 4949 | This is followed some time later by... |
4749 | .Bd -literal | 4950 | .Bd -unfilled -offset indent |
4750 | \& unable to find 'distinguished_name' in config | 4951 | unable to find 'distinguished_name' in config |
4751 | \& problems making Certificate Request | 4952 | problems making Certificate Request |
4752 | .Ed | 4953 | .Ed |
4753 | .Pp | 4954 | .Pp |
4754 | The first error message is the clue: it can't find the configuration | 4955 | The first error message is the clue: it can't find the configuration |
4755 | file! | 4956 | file! |
4756 | Certain operations (like examining a certificate request) don't | 4957 | Certain operations |
4757 | need a configuration file so its use isn't enforced. | 4958 | .Pq like examining a certificate request |
4959 | don't need a configuration file so its use isn't enforced. | ||
4758 | Generation of certificates or requests, however, do need a configuration file. | 4960 | Generation of certificates or requests, however, do need a configuration file. |
4759 | This could be regarded as a bug. | 4961 | This could be regarded as a bug. |
4760 | .Pp | 4962 | .Pp |
4761 | Another puzzling message is this: | 4963 | Another puzzling message is this: |
4762 | .Bd -literal | 4964 | .Bd -unfilled -offset indent |
4763 | \& Attributes: | 4965 | Attributes: |
4764 | \& a0:00 | 4966 | a0:00 |
4765 | .Ed | 4967 | .Ed |
4766 | .Pp | 4968 | .Pp |
4767 | This is displayed when no attributes are present and the request includes | 4969 | This is displayed when no attributes are present and the request includes |
4768 | the correct empty SET OF structure (the DER encoding of which is 0xa0 0x00). | 4970 | the correct empty SET OF structure |
4971 | .Pq the DER encoding of which is 0xa0 0x00 . | ||
4769 | If you just see: | 4972 | If you just see: |
4770 | .Pp | 4973 | .Pp |
4771 | \& Attributes: | 4974 | .D1 Attributes: |
4772 | .Pp | 4975 | .Pp |
4773 | then the SET OF is missing and the encoding is technically invalid (but | 4976 | then the SET OF is missing and the encoding is technically invalid |
4774 | it is tolerated). | 4977 | .Pq but it is tolerated . |
4775 | See the description of the command line option | 4978 | See the description of the command line option |
4776 | .Fl asn1-kludge | 4979 | .Fl asn1-kludge |
4777 | for more information. | 4980 | for more information. |
4778 | .Sh REQ ENVIRONMENT VARIABLES | 4981 | .Sh REQ ENVIRONMENT VARIABLES |
4779 | The variable | 4982 | The variable |
4780 | .Em OPENSSL_CONF , | 4983 | .Ev OPENSSL_CONF , |
4781 | if defined, allows an alternative configuration | 4984 | if defined, allows an alternative configuration |
4782 | file location to be specified; it will be overridden by the | 4985 | file location to be specified; it will be overridden by the |
4783 | .Fl config | 4986 | .Fl config |
4784 | command line switch if it is present. | 4987 | command line switch if it is present. |
4785 | For compatibility reasons the | 4988 | For compatibility reasons the |
4786 | .Em SSLEAY_CONF | 4989 | .Ev SSLEAY_CONF |
4787 | environment variable serves the same purpose but its use is discouraged. | 4990 | environment variable serves the same purpose but its use is discouraged. |
4788 | .Sh REQ BUGS | 4991 | .Sh REQ BUGS |
4789 | .Nm OpenSSL Ns Li 's | 4992 | .Nm OpenSSL Ns Li 's |
4790 | handling of T61Strings (aka TeletexStrings) is broken: it effectively | 4993 | handling of T61Strings |
4791 | treats them as ISO-8859-1 (Latin 1); | 4994 | .Pq aka TeletexStrings |
4995 | is broken: it effectively treats them as ISO-8859-1 | ||
4996 | .Pq Latin 1 ; | ||
4792 | Netscape and MSIE have similar behaviour. | 4997 | Netscape and MSIE have similar behaviour. |
4793 | This can cause problems if you need characters that aren't available in | 4998 | This can cause problems if you need characters that aren't available in |
4794 | .Em PrintableStrings | 4999 | .Em PrintableStrings |
4795 | and you don't want to or can't use | 5000 | and you don't want to or can't use |
4796 | .Em BMPStrings . | 5001 | .Em BMPStrings . |
4797 | .Pp | 5002 | .Pp |
4798 | As a consequence of the T61String handling the only correct way to represent | 5003 | As a consequence of the T61String handling, the only correct way to represent |
4799 | accented characters in | 5004 | accented characters in |
4800 | .Nm OpenSSL | 5005 | .Nm OpenSSL |
4801 | is to use a | 5006 | is to use a |
@@ -4806,10 +5011,10 @@ and MSIE then you currently need to use the invalid T61String form. | |||
4806 | .Pp | 5011 | .Pp |
4807 | The current prompting is not very friendly. | 5012 | The current prompting is not very friendly. |
4808 | It doesn't allow you to confirm what you've just entered. | 5013 | It doesn't allow you to confirm what you've just entered. |
4809 | Other things like extensions in certificate requests are | 5014 | Other things, like extensions in certificate requests, are |
4810 | statically defined in the configuration file. | 5015 | statically defined in the configuration file. |
4811 | Some of these, like an email address in | 5016 | Some of these, like an email address in |
4812 | .Em subjectAltName | 5017 | .Em subjectAltName , |
4813 | should be input by the user. | 5018 | should be input by the user. |
4814 | .\" | 5019 | .\" |
4815 | .\" RSA | 5020 | .\" RSA |
@@ -4817,16 +5022,17 @@ should be input by the user. | |||
4817 | .Sh RSA | 5022 | .Sh RSA |
4818 | .Cm openssl rsa | 5023 | .Cm openssl rsa |
4819 | .Bk -words | 5024 | .Bk -words |
4820 | .Op Fl inform Ar PEM|NET|DER | 5025 | .Op Fl inform Ar DER | NET | PEM |
4821 | .Op Fl outform Ar PEM|NET|DER | 5026 | .Op Fl outform Ar DER | NET | PEM |
4822 | .Op Fl in Ar filename | 5027 | .Op Fl in Ar filename |
4823 | .Op Fl passin Ar arg | 5028 | .Op Fl passin Ar arg |
4824 | .Op Fl out Ar filename | 5029 | .Op Fl out Ar filename |
4825 | .Op Fl passout Ar arg | 5030 | .Op Fl passout Ar arg |
4826 | .Op Fl sgckey | 5031 | .Op Fl sgckey |
4827 | .Op Fl des | 5032 | .Oo |
4828 | .Op Fl des3 | 5033 | .Fl des | des3 | aes128 | |
4829 | .Op Fl idea | 5034 | .Fl aes192 | aes256 |
5035 | .Oc | ||
4830 | .Op Fl text | 5036 | .Op Fl text |
4831 | .Op Fl noout | 5037 | .Op Fl noout |
4832 | .Op Fl modulus | 5038 | .Op Fl modulus |
@@ -4851,7 +5057,7 @@ utility. | |||
4851 | .Pp | 5057 | .Pp |
4852 | The options are as follows: | 5058 | The options are as follows: |
4853 | .Bl -tag -width "XXXX" | 5059 | .Bl -tag -width "XXXX" |
4854 | .It Fl inform Ar DER|NET|PEM | 5060 | .It Fl inform Ar DER | NET | PEM |
4855 | This specifies the input format. | 5061 | This specifies the input format. |
4856 | The | 5062 | The |
4857 | .Ar DER | 5063 | .Ar DER |
@@ -4868,8 +5074,8 @@ The | |||
4868 | form is a format described in the | 5074 | form is a format described in the |
4869 | .Sx RSA NOTES | 5075 | .Sx RSA NOTES |
4870 | section. | 5076 | section. |
4871 | .It Fl outform Ar DER|NET|PEM | 5077 | .It Fl outform Ar DER | NET | PEM |
4872 | This specifies the output format, the options have the same meaning as the | 5078 | This specifies the output format; the options have the same meaning as the |
4873 | .Fl inform | 5079 | .Fl inform |
4874 | option. | 5080 | option. |
4875 | .It Fl in Ar filename | 5081 | .It Fl in Ar filename |
@@ -4881,7 +5087,7 @@ If the key is encrypted, a pass phrase will be prompted for. | |||
4881 | .It Fl passin Ar arg | 5087 | .It Fl passin Ar arg |
4882 | The input file password source. | 5088 | The input file password source. |
4883 | For more information about the format of | 5089 | For more information about the format of |
4884 | .Ar arg | 5090 | .Ar arg , |
4885 | see the | 5091 | see the |
4886 | .Sx PASS PHRASE ARGUMENTS | 5092 | .Sx PASS PHRASE ARGUMENTS |
4887 | section above. | 5093 | section above. |
@@ -4889,14 +5095,14 @@ section above. | |||
4889 | This specifies the output | 5095 | This specifies the output |
4890 | .Ar filename | 5096 | .Ar filename |
4891 | to write a key to, or standard output if this option is not specified. | 5097 | to write a key to, or standard output if this option is not specified. |
4892 | If any encryption options are set then a pass phrase will be prompted for. | 5098 | If any encryption options are set then, a pass phrase will be prompted for. |
4893 | The output filename should | 5099 | The output filename should |
4894 | .Em not | 5100 | .Em not |
4895 | be the same as the input filename. | 5101 | be the same as the input filename. |
4896 | .It Fl passout Ar password | 5102 | .It Fl passout Ar password |
4897 | The output file password source. | 5103 | The output file password source. |
4898 | For more information about the format of | 5104 | For more information about the format of |
4899 | .Ar arg | 5105 | .Ar arg , |
4900 | see the | 5106 | see the |
4901 | .Sx PASS PHRASE ARGUMENTS | 5107 | .Sx PASS PHRASE ARGUMENTS |
4902 | section above. | 5108 | section above. |
@@ -4904,9 +5110,12 @@ section above. | |||
4904 | Use the modified | 5110 | Use the modified |
4905 | .Em NET | 5111 | .Em NET |
4906 | algorithm used with some versions of Microsoft IIS and SGC keys. | 5112 | algorithm used with some versions of Microsoft IIS and SGC keys. |
4907 | .It Cm -des|-des3|-idea | 5113 | .It Xo |
5114 | .Fl des | des3 | aes128 | | ||
5115 | .Fl aes192 | aes256 | ||
5116 | .Xc | ||
4908 | These options encrypt the private key with the DES, triple DES, or the | 5117 | These options encrypt the private key with the DES, triple DES, or the |
4909 | IDEA ciphers, respectively, before outputting it. | 5118 | AES ciphers, respectively, before outputting it. |
4910 | A pass phrase is prompted for. | 5119 | A pass phrase is prompted for. |
4911 | If none of these options is specified the key is written in plain text. | 5120 | If none of these options is specified the key is written in plain text. |
4912 | This means that using the | 5121 | This means that using the |
@@ -4927,17 +5136,17 @@ This option prints out the value of the modulus of the key. | |||
4927 | .It Fl check | 5136 | .It Fl check |
4928 | This option checks the consistency of an RSA private key. | 5137 | This option checks the consistency of an RSA private key. |
4929 | .It Fl pubin | 5138 | .It Fl pubin |
4930 | By default a private key is read from the input file: with this | 5139 | By default, a private key is read from the input file: with this |
4931 | option a public key is read instead. | 5140 | option a public key is read instead. |
4932 | .It Fl pubout | 5141 | .It Fl pubout |
4933 | By default a private key is output: | 5142 | By default, a private key is output: |
4934 | with this option a public key will be output instead. | 5143 | with this option a public key will be output instead. |
4935 | This option is automatically set if the input is a public key. | 5144 | This option is automatically set if the input is a public key. |
4936 | .It Fl engine Ar id | 5145 | .It Fl engine Ar id |
4937 | Specifying an engine (by it's unique | 5146 | Specifying an engine (by it's unique |
4938 | .Ar id | 5147 | .Ar id |
4939 | string) will cause | 5148 | string) will cause |
4940 | .Nm req | 5149 | .Nm rsa |
4941 | to attempt to obtain a functional reference to the specified engine, | 5150 | to attempt to obtain a functional reference to the specified engine, |
4942 | thus initialising it if needed. | 5151 | thus initialising it if needed. |
4943 | The engine will then be set as the default for all available algorithms. | 5152 | The engine will then be set as the default for all available algorithms. |
@@ -4946,17 +5155,17 @@ The engine will then be set as the default for all available algorithms. | |||
4946 | The | 5155 | The |
4947 | .Em PEM | 5156 | .Em PEM |
4948 | private key format uses the header and footer lines: | 5157 | private key format uses the header and footer lines: |
4949 | .Bd -literal | 5158 | .Bd -unfilled -offset indent |
4950 | \& -----BEGIN RSA PRIVATE KEY----- | 5159 | -----BEGIN RSA PRIVATE KEY----- |
4951 | \& -----END RSA PRIVATE KEY----- | 5160 | -----END RSA PRIVATE KEY----- |
4952 | .Ed | 5161 | .Ed |
4953 | .Pp | 5162 | .Pp |
4954 | The | 5163 | The |
4955 | .Em PEM | 5164 | .Em PEM |
4956 | public key format uses the header and footer lines: | 5165 | public key format uses the header and footer lines: |
4957 | .Bd -literal | 5166 | .Bd -unfilled -offset indent |
4958 | \& -----BEGIN PUBLIC KEY----- | 5167 | -----BEGIN PUBLIC KEY----- |
4959 | \& -----END PUBLIC KEY----- | 5168 | -----END PUBLIC KEY----- |
4960 | .Ed | 5169 | .Ed |
4961 | .Pp | 5170 | .Pp |
4962 | The | 5171 | The |
@@ -4969,8 +5178,10 @@ Some newer version of IIS have additional data in the exported .key files. | |||
4969 | To use these with the | 5178 | To use these with the |
4970 | .Nm rsa | 5179 | .Nm rsa |
4971 | utility, view the file with a binary editor | 5180 | utility, view the file with a binary editor |
4972 | and look for the string "private-key", then trace back to the byte | 5181 | and look for the string |
4973 | sequence 0x30, 0x82 (this is an ASN1 SEQUENCE). | 5182 | .Qq private-key , |
5183 | then trace back to the byte sequence 0x30, 0x82 | ||
5184 | .Pq this is an ASN1 SEQUENCE . | ||
4974 | Copy all the data from this point onwards to another file and use that as | 5185 | Copy all the data from this point onwards to another file and use that as |
4975 | the input to the | 5186 | the input to the |
4976 | .Nm rsa | 5187 | .Nm rsa |
@@ -4983,11 +5194,11 @@ option. | |||
4983 | .Sh RSA EXAMPLES | 5194 | .Sh RSA EXAMPLES |
4984 | To remove the pass phrase on an RSA private key: | 5195 | To remove the pass phrase on an RSA private key: |
4985 | .Pp | 5196 | .Pp |
4986 | \& $ openssl rsa -in key.pem -out keyout.pem | 5197 | .Dl $ openssl rsa -in key.pem -out keyout.pem |
4987 | .Pp | 5198 | .Pp |
4988 | To encrypt a private key using triple DES: | 5199 | To encrypt a private key using triple DES: |
4989 | .Pp | 5200 | .Pp |
4990 | \& $ openssl rsa -in key.pem -des3 -out keyout.pem | 5201 | .Dl $ openssl rsa -in key.pem -des3 -out keyout.pem |
4991 | .Pp | 5202 | .Pp |
4992 | To convert a private key from | 5203 | To convert a private key from |
4993 | .Em PEM | 5204 | .Em PEM |
@@ -4995,15 +5206,15 @@ to | |||
4995 | .Em DER | 5206 | .Em DER |
4996 | format: | 5207 | format: |
4997 | .Pp | 5208 | .Pp |
4998 | \& $ openssl rsa -in key.pem -outform DER -out keyout.der | 5209 | .Dl $ openssl rsa -in key.pem -outform DER -out keyout.der |
4999 | .Pp | 5210 | .Pp |
5000 | To print out the components of a private key to standard output: | 5211 | To print out the components of a private key to standard output: |
5001 | .Pp | 5212 | .Pp |
5002 | \& $ openssl rsa -in key.pem -text -noout | 5213 | .Dl $ openssl rsa -in key.pem -text -noout |
5003 | .Pp | 5214 | .Pp |
5004 | To just output the public part of a private key: | 5215 | To just output the public part of a private key: |
5005 | .Pp | 5216 | .Pp |
5006 | \& $ openssl rsa -in key.pem -pubout -out pubkey.pem | 5217 | .Dl $ openssl rsa -in key.pem -pubout -out pubkey.pem |
5007 | .Sh RSA BUGS | 5218 | .Sh RSA BUGS |
5008 | The command line password arguments don't currently work with | 5219 | The command line password arguments don't currently work with |
5009 | .Em NET | 5220 | .Em NET |
@@ -5016,20 +5227,22 @@ without having to manually edit them. | |||
5016 | .\" | 5227 | .\" |
5017 | .Sh RSAUTL | 5228 | .Sh RSAUTL |
5018 | .Nm openssl rsautl | 5229 | .Nm openssl rsautl |
5230 | .Bk -words | ||
5019 | .Op Fl in Ar file | 5231 | .Op Fl in Ar file |
5020 | .Op Fl out Ar file | 5232 | .Op Fl out Ar file |
5021 | .Op Fl inkey Ar file | 5233 | .Op Fl inkey Ar file |
5234 | .Op Fl keyform Ar DER | PEM | ||
5022 | .Op Fl pubin | 5235 | .Op Fl pubin |
5023 | .Op Fl certin | 5236 | .Op Fl certin |
5024 | .Op Fl sign | 5237 | .Op Fl sign |
5025 | .Op Fl verify | 5238 | .Op Fl verify |
5026 | .Op Fl encrypt | 5239 | .Op Fl encrypt |
5027 | .Op Fl decrypt | 5240 | .Op Fl decrypt |
5028 | .Op Fl pkcs | 5241 | .Op Fl pkcs | oaep | ssl | raw |
5029 | .Op Fl ssl | ||
5030 | .Op Fl raw | ||
5031 | .Op Fl hexdump | 5242 | .Op Fl hexdump |
5032 | .Op Fl asn1parse | 5243 | .Op Fl asn1parse |
5244 | .Op Fl engine Ar id | ||
5245 | .Ek | ||
5033 | .Pp | 5246 | .Pp |
5034 | The | 5247 | The |
5035 | .Nm rsautl | 5248 | .Nm rsautl |
@@ -5050,6 +5263,10 @@ to write to or standard output by | |||
5050 | default. | 5263 | default. |
5051 | .It Fl inkey Ar file | 5264 | .It Fl inkey Ar file |
5052 | The input key file, by default it should be an RSA private key. | 5265 | The input key file, by default it should be an RSA private key. |
5266 | .It Fl keyform Ar DER | PEM | ||
5267 | Private ket format. | ||
5268 | Default is | ||
5269 | .Ar PEM . | ||
5053 | .It Fl pubin | 5270 | .It Fl pubin |
5054 | The input file is an RSA public key. | 5271 | The input file is an RSA public key. |
5055 | .It Fl certin | 5272 | .It Fl certin |
@@ -5063,9 +5280,10 @@ Verify the input data and output the recovered data. | |||
5063 | Encrypt the input data using an RSA public key. | 5280 | Encrypt the input data using an RSA public key. |
5064 | .It Fl decrypt | 5281 | .It Fl decrypt |
5065 | Decrypt the input data using an RSA private key. | 5282 | Decrypt the input data using an RSA private key. |
5066 | .It Fl pkcs , oaep , ssl , raw | 5283 | .It Fl pkcs | oaep | ssl | raw |
5067 | The padding to use: PKCS#1 v1.5 (the default), PKCS#1 OAEP, | 5284 | The padding to use: PKCS#1 v1.5 |
5068 | special padding used in SSL v2 backwards compatible handshakes, | 5285 | .Pq the default , |
5286 | PKCS#1 OAEP, special padding used in SSL v2 backwards compatible handshakes, | ||
5069 | or no padding, respectively. | 5287 | or no padding, respectively. |
5070 | For signatures, only | 5288 | For signatures, only |
5071 | .Fl pkcs | 5289 | .Fl pkcs |
@@ -5075,9 +5293,17 @@ can be used. | |||
5075 | .It Fl hexdump | 5293 | .It Fl hexdump |
5076 | Hex dump the output data. | 5294 | Hex dump the output data. |
5077 | .It Fl asn1parse | 5295 | .It Fl asn1parse |
5078 | Asn1parse the output data, this is useful when combined with the | 5296 | Asn1parse the output data; this is useful when combined with the |
5079 | .Fl verify | 5297 | .Fl verify |
5080 | option. | 5298 | option. |
5299 | .It Fl engine Ar id | ||
5300 | Specifying an engine (by it's unique | ||
5301 | .Ar id | ||
5302 | string) will cause | ||
5303 | .Nm rsautl | ||
5304 | to attempt to obtain a functional reference to the specified engine, | ||
5305 | thus initialising it if needed. | ||
5306 | The engine will then be set as the default for all available algorithms. | ||
5081 | .El | 5307 | .El |
5082 | .Sh RSAUTL NOTES | 5308 | .Sh RSAUTL NOTES |
5083 | .Nm rsautl , | 5309 | .Nm rsautl , |
@@ -5086,16 +5312,16 @@ used to sign or verify small pieces of data. | |||
5086 | .Sh RSAUTL EXAMPLES | 5312 | .Sh RSAUTL EXAMPLES |
5087 | Sign some data using a private key: | 5313 | Sign some data using a private key: |
5088 | .Pp | 5314 | .Pp |
5089 | \& $ openssl rsautl -sign -in file -inkey key.pem -out sig | 5315 | .Dl "$ openssl rsautl -sign -in file -inkey key.pem -out sig" |
5090 | .Pp | 5316 | .Pp |
5091 | Recover the signed data: | 5317 | Recover the signed data: |
5092 | .Pp | 5318 | .Pp |
5093 | \& $ openssl rsautl -verify -in sig -inkey key.pem | 5319 | .Dl $ openssl rsautl -verify -in sig -inkey key.pem |
5094 | .Pp | 5320 | .Pp |
5095 | Examine the raw signed data: | 5321 | Examine the raw signed data: |
5096 | .Pp | 5322 | .Pp |
5097 | \& $ openssl rsautl -verify -in file -inkey key.pem -raw -hexdump | 5323 | .Li "\ \&$ openssl rsautl -verify -in file -inkey key.pem -raw -hexdump" |
5098 | .Bd -literal | 5324 | .Bd -unfilled |
5099 | \& 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ | 5325 | \& 0000 - 00 01 ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ |
5100 | \& 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ | 5326 | \& 0010 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ |
5101 | \& 0020 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ | 5327 | \& 0020 - ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff ................ |
@@ -5106,8 +5332,9 @@ Examine the raw signed data: | |||
5106 | \& 0070 - ff ff ff ff 00 68 65 6c-6c 6f 20 77 6f 72 6c 64 .....hello world | 5332 | \& 0070 - ff ff ff ff 00 68 65 6c-6c 6f 20 77 6f 72 6c 64 .....hello world |
5107 | .Ed | 5333 | .Ed |
5108 | .Pp | 5334 | .Pp |
5109 | The PKCS#1 block formatting is evident from this. If this was done using | 5335 | The PKCS#1 block formatting is evident from this. |
5110 | encrypt and decrypt the block would have been of type 2 (the second byte) | 5336 | If this was done using encrypt and decrypt, the block would have been of type 2 |
5337 | .Pq the second byte | ||
5111 | and random padding data visible instead of the 0xff bytes. | 5338 | and random padding data visible instead of the 0xff bytes. |
5112 | .Pp | 5339 | .Pp |
5113 | It is possible to analyse the signature of certificates using this | 5340 | It is possible to analyse the signature of certificates using this |
@@ -5115,12 +5342,12 @@ utility in conjunction with | |||
5115 | .Nm asn1parse . | 5342 | .Nm asn1parse . |
5116 | Consider the self-signed example in | 5343 | Consider the self-signed example in |
5117 | .Pa certs/pca-cert.pem : | 5344 | .Pa certs/pca-cert.pem : |
5118 | Running | 5345 | running |
5119 | .Nm asn1parse | 5346 | .Nm asn1parse |
5120 | as follows yields: | 5347 | as follows yields: |
5121 | .Pp | 5348 | .Pp |
5122 | \& $ openssl asn1parse -in pca-cert.pem | 5349 | .Li "\ \&$ openssl asn1parse -in pca-cert.pem" |
5123 | .Bd -literal | 5350 | .Bd -unfilled |
5124 | \& 0:d=0 hl=4 l= 742 cons: SEQUENCE | 5351 | \& 0:d=0 hl=4 l= 742 cons: SEQUENCE |
5125 | \& 4:d=1 hl=4 l= 591 cons: SEQUENCE | 5352 | \& 4:d=1 hl=4 l= 591 cons: SEQUENCE |
5126 | \& 8:d=2 hl=2 l= 3 cons: cont [ 0 ] | 5353 | \& 8:d=2 hl=2 l= 3 cons: cont [ 0 ] |
@@ -5144,22 +5371,22 @@ as follows yields: | |||
5144 | The final BIT STRING contains the actual signature. | 5371 | The final BIT STRING contains the actual signature. |
5145 | It can be extracted with: | 5372 | It can be extracted with: |
5146 | .Pp | 5373 | .Pp |
5147 | \& $ openssl asn1parse -in pca-cert.pem -out sig -noout -strparse 614 | 5374 | .Dl "$ openssl asn1parse -in pca-cert.pem -out sig -noout -strparse 614" |
5148 | .Pp | 5375 | .Pp |
5149 | The certificate public key can be extracted with: | 5376 | The certificate public key can be extracted with: |
5150 | .Pp | 5377 | .Pp |
5151 | \& $ openssl x509 -in test/testx509.pem -pubout -noout >pubkey.pem | 5378 | .Dl $ openssl x509 -in test/testx509.pem -pubout -noout >pubkey.pem |
5152 | .Pp | 5379 | .Pp |
5153 | The signature can be analysed with: | 5380 | The signature can be analysed with: |
5154 | .Pp | 5381 | .Pp |
5155 | \& $ openssl rsautl -in sig -verify -asn1parse -inkey pubkey.pem -pubin | 5382 | .Li "\ \&$ openssl rsautl -in sig -verify -asn1parse -inkey pubkey.pem -pubin" |
5156 | .Bd -literal | 5383 | .Bd -unfilled |
5157 | \& 0:d=0 hl=2 l= 32 cons: SEQUENCE | 5384 | \& 0:d=0 hl=2 l= 32 cons: SEQUENCE |
5158 | \& 2:d=1 hl=2 l= 12 cons: SEQUENCE | 5385 | \& 2:d=1 hl=2 l= 12 cons: SEQUENCE |
5159 | \& 4:d=2 hl=2 l= 8 prim: OBJECT :md5 | 5386 | \& 4:d=2 hl=2 l= 8 prim: OBJECT :md5 |
5160 | \& 14:d=2 hl=2 l= 0 prim: NULL | 5387 | \& 14:d=2 hl=2 l= 0 prim: NULL |
5161 | \& 16:d=1 hl=2 l= 16 prim: OCTET STRING | 5388 | \& 16:d=1 hl=2 l= 16 prim: OCTET STRING |
5162 | \& 0000 - f3 46 9e aa 1a 4a 73 c9-37 ea 93 00 48 25 08 b5 .F...Js.7...H%.. | 5389 | \& 0000 - f3 46 9e aa 1a 4a 73 c9-37 ea 93 00 48 25 08 b5 .F...Js.7...H%.. |
5163 | .Ed | 5390 | .Ed |
5164 | .Pp | 5391 | .Pp |
5165 | This is the parsed version of an ASN1 | 5392 | This is the parsed version of an ASN1 |
@@ -5168,13 +5395,12 @@ structure. | |||
5168 | It can be seen that the digest used was md5. | 5395 | It can be seen that the digest used was md5. |
5169 | The actual part of the certificate that was signed can be extracted with: | 5396 | The actual part of the certificate that was signed can be extracted with: |
5170 | .Pp | 5397 | .Pp |
5171 | \& $ openssl asn1parse -in pca-cert.pem -out tbs -noout -strparse 4 | 5398 | .Dl "$ openssl asn1parse -in pca-cert.pem -out tbs -noout -strparse 4" |
5172 | .Pp | 5399 | .Pp |
5173 | and its digest computed with: | 5400 | and its digest computed with: |
5174 | .Bd -literal | 5401 | .Pp |
5175 | \& $ openssl md5 -c tbs | 5402 | .Dl $ openssl md5 -c tbs |
5176 | \& MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5 | 5403 | .D1 MD5(tbs)= f3:46:9e:aa:1a:4a:73:c9:37:ea:93:00:48:25:08:b5 |
5177 | .Ed | ||
5178 | .Pp | 5404 | .Pp |
5179 | which it can be seen agrees with the recovered value above. | 5405 | which it can be seen agrees with the recovered value above. |
5180 | .\" | 5406 | .\" |
@@ -5183,7 +5409,9 @@ which it can be seen agrees with the recovered value above. | |||
5183 | .Sh S_CLIENT | 5409 | .Sh S_CLIENT |
5184 | .Nm openssl s_client | 5410 | .Nm openssl s_client |
5185 | .Bk -words | 5411 | .Bk -words |
5186 | .Op Fl connect Ar host:port> | 5412 | .Oo |
5413 | .Fl connect Ar host Ns : Ns Ar port | ||
5414 | .Oc | ||
5187 | .Op Fl verify Ar depth | 5415 | .Op Fl verify Ar depth |
5188 | .Op Fl cert Ar filename | 5416 | .Op Fl cert Ar filename |
5189 | .Op Fl key Ar filename | 5417 | .Op Fl key Ar filename |
@@ -5192,6 +5420,7 @@ which it can be seen agrees with the recovered value above. | |||
5192 | .Op Fl reconnect | 5420 | .Op Fl reconnect |
5193 | .Op Fl pause | 5421 | .Op Fl pause |
5194 | .Op Fl showcerts | 5422 | .Op Fl showcerts |
5423 | .Op Fl prexit | ||
5195 | .Op Fl debug | 5424 | .Op Fl debug |
5196 | .Op Fl msg | 5425 | .Op Fl msg |
5197 | .Op Fl nbio_test | 5426 | .Op Fl nbio_test |
@@ -5207,9 +5436,9 @@ which it can be seen agrees with the recovered value above. | |||
5207 | .Op Fl no_ssl3 | 5436 | .Op Fl no_ssl3 |
5208 | .Op Fl no_tls1 | 5437 | .Op Fl no_tls1 |
5209 | .Op Fl bugs | 5438 | .Op Fl bugs |
5439 | .Op Fl serverpref | ||
5210 | .Op Fl cipher Ar cipherlist | 5440 | .Op Fl cipher Ar cipherlist |
5211 | .Op Fl starttls Ar protocol | 5441 | .Op Fl starttls Ar protocol |
5212 | .Op Fl starttls Ar protocol | ||
5213 | .Op Fl engine Ar id | 5442 | .Op Fl engine Ar id |
5214 | .Op Fl rand Ar file ... | 5443 | .Op Fl rand Ar file ... |
5215 | .Ek | 5444 | .Ek |
@@ -5224,20 +5453,22 @@ useful diagnostic tool for SSL servers. | |||
5224 | .Pp | 5453 | .Pp |
5225 | The options are as follows: | 5454 | The options are as follows: |
5226 | .Bl -tag -width "XXXX" | 5455 | .Bl -tag -width "XXXX" |
5227 | .It Fl connect Ar host:port | 5456 | .It Xo |
5457 | .Fl connect Ar host Ns : Ns Ar port | ||
5458 | .Xc | ||
5228 | This specifies the | 5459 | This specifies the |
5229 | .Ar host | 5460 | .Ar host |
5230 | and optional | 5461 | and optional |
5231 | .Ar port | 5462 | .Ar port |
5232 | to connect to. | 5463 | to connect to. |
5233 | If not specified then an attempt is made to connect to the local host | 5464 | If not specified, then an attempt is made to connect to the local host |
5234 | on port 4433. | 5465 | on port 4433. |
5235 | .It Fl cert Ar certname | 5466 | .It Fl cert Ar certname |
5236 | The certificate to use, if one is requested by the server. | 5467 | The certificate to use, if one is requested by the server. |
5237 | The default is not to use a certificate. | 5468 | The default is not to use a certificate. |
5238 | .It Fl key Ar keyfile | 5469 | .It Fl key Ar keyfile |
5239 | The private key to use. | 5470 | The private key to use. |
5240 | If not specified then the certificate file will be used. | 5471 | If not specified, then the certificate file will be used. |
5241 | .It Fl verify Ar depth | 5472 | .It Fl verify Ar depth |
5242 | The verify | 5473 | The verify |
5243 | .Ar depth | 5474 | .Ar depth |
@@ -5252,7 +5483,9 @@ certificate verify failure. | |||
5252 | The | 5483 | The |
5253 | .Ar directory | 5484 | .Ar directory |
5254 | to use for server certificate verification. | 5485 | to use for server certificate verification. |
5255 | This directory must be in "hash format", see | 5486 | This directory must be in |
5487 | .Qq hash format ; | ||
5488 | see | ||
5256 | .Fl verify | 5489 | .Fl verify |
5257 | for more information. | 5490 | for more information. |
5258 | These are also used when building the client certificate chain. | 5491 | These are also used when building the client certificate chain. |
@@ -5273,7 +5506,7 @@ certificate itself is displayed. | |||
5273 | Print session information when the program exits. | 5506 | Print session information when the program exits. |
5274 | This will always attempt | 5507 | This will always attempt |
5275 | to print out information even if the connection fails. | 5508 | to print out information even if the connection fails. |
5276 | Normally information will only be printed out once if the connection succeeds. | 5509 | Normally, information will only be printed out once if the connection succeeds. |
5277 | This option is useful because the cipher in use may be renegotiated | 5510 | This option is useful because the cipher in use may be renegotiated |
5278 | or the connection may fail because a client certificate is required or is | 5511 | or the connection may fail because a client certificate is required or is |
5279 | requested only after an attempt is made to access a certain URL. | 5512 | requested only after an attempt is made to access a certain URL. |
@@ -5301,10 +5534,12 @@ Inhibit printing of session and certificate information. | |||
5301 | This implicitly turns on | 5534 | This implicitly turns on |
5302 | .Fl ign_eof | 5535 | .Fl ign_eof |
5303 | as well. | 5536 | as well. |
5304 | .It Fl ssl2 , ssl3 , tls1 , no_ssl2 , | 5537 | .It Xo |
5305 | .It Fl no_ssl3 , no_tls1 | 5538 | .Fl ssl2 | ssl3 | tls1 | |
5539 | .Fl no_ssl2 | no_ssl3 | no_tls1 | ||
5540 | .Xc | ||
5306 | These options disable the use of certain SSL or TLS protocols. | 5541 | These options disable the use of certain SSL or TLS protocols. |
5307 | By default the initial handshake uses a method which should be compatible | 5542 | By default, the initial handshake uses a method which should be compatible |
5308 | with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. | 5543 | with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. |
5309 | .Pp | 5544 | .Pp |
5310 | Unfortunately there are a lot of ancient and broken servers in use which | 5545 | Unfortunately there are a lot of ancient and broken servers in use which |
@@ -5317,9 +5552,12 @@ option. | |||
5317 | .It Fl bugs | 5552 | .It Fl bugs |
5318 | There are several known bugs in SSL and TLS implementations. | 5553 | There are several known bugs in SSL and TLS implementations. |
5319 | Adding this option enables various workarounds. | 5554 | Adding this option enables various workarounds. |
5555 | .It Fl serverpref | ||
5556 | Use server's cipher preferences | ||
5557 | .Pq SSLv2 only . | ||
5320 | .It Fl cipher Ar cipherlist | 5558 | .It Fl cipher Ar cipherlist |
5321 | This allows the cipher list sent by the client to be modified. | 5559 | This allows the cipher list sent by the client to be modified. |
5322 | Although the server determines which cipher suite is used it should take | 5560 | Although the server determines which cipher suite is used, it should take |
5323 | the first supported cipher in the list sent by the client. | 5561 | the first supported cipher in the list sent by the client. |
5324 | See the | 5562 | See the |
5325 | .Sx CIPHERS | 5563 | .Sx CIPHERS |
@@ -5328,7 +5566,8 @@ section above for more information. | |||
5328 | Send the protocol-specific message(s) to switch to TLS for communication. | 5566 | Send the protocol-specific message(s) to switch to TLS for communication. |
5329 | .Ar protocol | 5567 | .Ar protocol |
5330 | is a keyword for the intended protocol. | 5568 | is a keyword for the intended protocol. |
5331 | Currently, the only supported keyword is "smtp". | 5569 | Currently, the only supported keyword is |
5570 | .Qq smtp . | ||
5332 | .It Fl engine Ar id | 5571 | .It Fl engine Ar id |
5333 | Specifying an engine (by it's unique | 5572 | Specifying an engine (by it's unique |
5334 | .Ar id | 5573 | .Ar id |
@@ -5338,25 +5577,14 @@ to attempt to obtain a functional reference to the specified engine, | |||
5338 | thus initialising it if needed. | 5577 | thus initialising it if needed. |
5339 | The engine will then be set as the default for all available algorithms. | 5578 | The engine will then be set as the default for all available algorithms. |
5340 | .It Fl rand Ar file ... | 5579 | .It Fl rand Ar file ... |
5341 | A | 5580 | A file or files containing random data used to seed the random number generator, |
5342 | .Ar file | ||
5343 | or | ||
5344 | .Ar file Ns Li s | ||
5345 | containing random data used to seed the random number generator, | ||
5346 | or an EGD socket (see | 5581 | or an EGD socket (see |
5347 | .Xr RAND_egd 3 ) . | 5582 | .Xr RAND_egd 3 ) . |
5348 | Multiple files can be specified separated by an OS-dependent character. | 5583 | Multiple files can be specified separated by a |
5349 | The separator is | 5584 | .Sq \&: . |
5350 | .Cm \&; | ||
5351 | for MS-Windows, | ||
5352 | .Cm \&, | ||
5353 | for OpenVMS, and | ||
5354 | .Cm \&: | ||
5355 | for | ||
5356 | all others. | ||
5357 | .El | 5585 | .El |
5358 | .Sh S_CLIENT CONNECTED COMMANDS | 5586 | .Sh S_CLIENT CONNECTED COMMANDS |
5359 | If a connection is established with an SSL server then any data received | 5587 | If a connection is established with an SSL server, then any data received |
5360 | from the server is displayed and any key presses will be sent to the | 5588 | from the server is displayed and any key presses will be sent to the |
5361 | server. | 5589 | server. |
5362 | When used interactively (which means neither | 5590 | When used interactively (which means neither |
@@ -5364,8 +5592,8 @@ When used interactively (which means neither | |||
5364 | nor | 5592 | nor |
5365 | .Fl ign_eof | 5593 | .Fl ign_eof |
5366 | have been given), the session will be renegotiated if the line begins with an | 5594 | have been given), the session will be renegotiated if the line begins with an |
5367 | .Em R , | 5595 | .Em R ; |
5368 | and if the line begins with a | 5596 | if the line begins with a |
5369 | .Em Q | 5597 | .Em Q |
5370 | or if end of file is reached, the connection will be closed down. | 5598 | or if end of file is reached, the connection will be closed down. |
5371 | .Sh S_CLIENT NOTES | 5599 | .Sh S_CLIENT NOTES |
@@ -5373,14 +5601,16 @@ or if end of file is reached, the connection will be closed down. | |||
5373 | can be used to debug SSL servers. | 5601 | can be used to debug SSL servers. |
5374 | To connect to an SSL HTTP server the command: | 5602 | To connect to an SSL HTTP server the command: |
5375 | .Pp | 5603 | .Pp |
5376 | \& $ openssl s_client -connect servername:443 | 5604 | .Dl $ openssl s_client -connect servername:443 |
5377 | .Pp | 5605 | .Pp |
5378 | would typically be used (https uses port 443). | 5606 | would typically be used |
5379 | If the connection succeeds then an HTTP command can be given such as | 5607 | .Pq HTTPS uses port 443 . |
5380 | "GET" to retrieve a web page. | 5608 | If the connection succeeds, then an HTTP command can be given such as |
5609 | .Qq GET | ||
5610 | to retrieve a web page. | ||
5381 | .Pp | 5611 | .Pp |
5382 | If the handshake fails then there are several possible causes; if it is | 5612 | If the handshake fails, then there are several possible causes; if it is |
5383 | nothing obvious like no client certificate then the | 5613 | nothing obvious like no client certificate, then the |
5384 | .Fl bugs , ssl2 , ssl3 , tls1 , | 5614 | .Fl bugs , ssl2 , ssl3 , tls1 , |
5385 | .Fl no_ssl2 , no_ssl3 | 5615 | .Fl no_ssl2 , no_ssl3 |
5386 | and | 5616 | and |
@@ -5395,9 +5625,10 @@ mailing list. | |||
5395 | A frequent problem when attempting to get client certificates working | 5625 | A frequent problem when attempting to get client certificates working |
5396 | is that a web client complains it has no certificates or gives an empty | 5626 | is that a web client complains it has no certificates or gives an empty |
5397 | list to choose from. | 5627 | list to choose from. |
5398 | This is normally because the server is not sending the clients certificate | 5628 | This is normally because the server is not sending the client's certificate |
5399 | authority in its "acceptable CA list" when it | 5629 | authority in its |
5400 | requests a certificate. | 5630 | .Qq acceptable CA list |
5631 | when it requests a certificate. | ||
5401 | By using | 5632 | By using |
5402 | .Nm s_client | 5633 | .Nm s_client |
5403 | the CA list can be viewed and checked. | 5634 | the CA list can be viewed and checked. |
@@ -5409,12 +5640,12 @@ command and send an HTTP request for an appropriate page. | |||
5409 | .Pp | 5640 | .Pp |
5410 | If a certificate is specified on the command line using the | 5641 | If a certificate is specified on the command line using the |
5411 | .Fl cert | 5642 | .Fl cert |
5412 | option it will not be used unless the server specifically requests | 5643 | option, it will not be used unless the server specifically requests |
5413 | a client certificate. | 5644 | a client certificate. |
5414 | Therefore merely including a client certificate | 5645 | Therefore merely including a client certificate |
5415 | on the command line is no guarantee that the certificate works. | 5646 | on the command line is no guarantee that the certificate works. |
5416 | .Pp | 5647 | .Pp |
5417 | If there are problems verifying a server certificate then the | 5648 | If there are problems verifying a server certificate, then the |
5418 | .Fl showcerts | 5649 | .Fl showcerts |
5419 | option can be used to show the whole chain. | 5650 | option can be used to show the whole chain. |
5420 | .Sh S_CLIENT BUGS | 5651 | .Sh S_CLIENT BUGS |
@@ -5457,6 +5688,7 @@ We should really report information whenever a session is renegotiated. | |||
5457 | .Op Fl CAfile Ar filename | 5688 | .Op Fl CAfile Ar filename |
5458 | .Op Fl nocert | 5689 | .Op Fl nocert |
5459 | .Op Fl cipher Ar cipherlist | 5690 | .Op Fl cipher Ar cipherlist |
5691 | .Op Fl serverpref | ||
5460 | .Op Fl quiet | 5692 | .Op Fl quiet |
5461 | .Op Fl no_tmp_rsa | 5693 | .Op Fl no_tmp_rsa |
5462 | .Op Fl ssl2 | 5694 | .Op Fl ssl2 |
@@ -5493,16 +5725,17 @@ Sets the SSL context id. | |||
5493 | It can be given any string value. | 5725 | It can be given any string value. |
5494 | If this option is not present, a default value will be used. | 5726 | If this option is not present, a default value will be used. |
5495 | .It Fl cert Ar certname | 5727 | .It Fl cert Ar certname |
5496 | The certificate to use; most servers cipher suites require the use of a | 5728 | The certificate to use; most server's cipher suites require the use of a |
5497 | certificate and some require a certificate with a certain public key type: | 5729 | certificate and some require a certificate with a certain public key type: |
5498 | for example the DSS cipher suites require a certificate containing a DSS | 5730 | for example the DSS cipher suites require a certificate containing a DSS |
5499 | (DSA) key. | 5731 | .Pq DSA |
5500 | If not specified then the filename | 5732 | key. |
5733 | If not specified, then the filename | ||
5501 | .Pa server.pem | 5734 | .Pa server.pem |
5502 | will be used. | 5735 | will be used. |
5503 | .It Fl key Ar keyfile | 5736 | .It Fl key Ar keyfile |
5504 | The private key to use. | 5737 | The private key to use. |
5505 | If not specified then the certificate file will be used. | 5738 | If not specified, then the certificate file will be used. |
5506 | .It Fl dcert Ar filename , Fl dkey Ar keyname | 5739 | .It Fl dcert Ar filename , Fl dkey Ar keyname |
5507 | Specify an additional certificate and private key; these behave in the | 5740 | Specify an additional certificate and private key; these behave in the |
5508 | same manner as the | 5741 | same manner as the |
@@ -5510,18 +5743,20 @@ same manner as the | |||
5510 | and | 5743 | and |
5511 | .Fl key | 5744 | .Fl key |
5512 | options except there is no default if they are not specified | 5745 | options except there is no default if they are not specified |
5513 | (no additional certificate and key is used). | 5746 | .Pq no additional certificate and key is used . |
5514 | As noted above some cipher suites require a certificate containing a key of | 5747 | As noted above some cipher suites require a certificate containing a key of |
5515 | a certain type. | 5748 | a certain type. |
5516 | Some cipher suites need a certificate carrying an RSA key | 5749 | Some cipher suites need a certificate carrying an RSA key |
5517 | and some a DSS (DSA) key. | 5750 | and some a DSS |
5751 | .Pq DSA | ||
5752 | key. | ||
5518 | By using RSA and DSS certificates and keys | 5753 | By using RSA and DSS certificates and keys |
5519 | a server can support clients which only support RSA or DSS cipher suites | 5754 | a server can support clients which only support RSA or DSS cipher suites |
5520 | by using an appropriate certificate. | 5755 | by using an appropriate certificate. |
5521 | .It Fl nocert | 5756 | .It Fl nocert |
5522 | If this option is set then no certificate is used. | 5757 | If this option is set, then no certificate is used. |
5523 | This restricts the cipher suites available to the anonymous ones | 5758 | This restricts the cipher suites available to the anonymous ones |
5524 | (currently just anonymous DH). | 5759 | .Pq currently just anonymous DH . |
5525 | .It Fl dhparam Ar filename | 5760 | .It Fl dhparam Ar filename |
5526 | The DH parameter file to use. | 5761 | The DH parameter file to use. |
5527 | The ephemeral DH cipher suites generate keys | 5762 | The ephemeral DH cipher suites generate keys |
@@ -5545,15 +5780,17 @@ This specifies the maximum length of the client certificate chain | |||
5545 | and makes the server request a certificate from the client. | 5780 | and makes the server request a certificate from the client. |
5546 | With the | 5781 | With the |
5547 | .Fl verify | 5782 | .Fl verify |
5548 | option a certificate is requested but the client does not have to send one. | 5783 | option, a certificate is requested but the client does not have to send one. |
5549 | With the | 5784 | With the |
5550 | .Fl Verify | 5785 | .Fl Verify |
5551 | option the client must supply a certificate or an error occurs. | 5786 | option, the client must supply a certificate or an error occurs. |
5552 | .It Fl CApath Ar directory | 5787 | .It Fl CApath Ar directory |
5553 | The | 5788 | The |
5554 | .Ar directory | 5789 | .Ar directory |
5555 | to use for client certificate verification. | 5790 | to use for client certificate verification. |
5556 | This directory must be in "hash format", see | 5791 | This directory must be in |
5792 | .Qq hash format ; | ||
5793 | see | ||
5557 | .Fl verify | 5794 | .Fl verify |
5558 | for more information. | 5795 | for more information. |
5559 | These are also used when building the server certificate chain. | 5796 | These are also used when building the server certificate chain. |
@@ -5569,15 +5806,17 @@ Print extensive debugging information including a hex dump of all traffic. | |||
5569 | .It Fl msg | 5806 | .It Fl msg |
5570 | Show all protocol messages with hex dump. | 5807 | Show all protocol messages with hex dump. |
5571 | .It Fl nbio_test | 5808 | .It Fl nbio_test |
5572 | Tests non blocking I/O. | 5809 | Tests non-blocking I/O. |
5573 | .It Fl nbio | 5810 | .It Fl nbio |
5574 | Turns on non blocking I/O. | 5811 | Turns on non-blocking I/O. |
5575 | .It Fl crlf | 5812 | .It Fl crlf |
5576 | This option translates a line feed from the terminal into CR+LF. | 5813 | This option translates a line feed from the terminal into CR+LF. |
5577 | .It Fl quiet | 5814 | .It Fl quiet |
5578 | Inhibit printing of session and certificate information. | 5815 | Inhibit printing of session and certificate information. |
5579 | .It Fl ssl2 , ssl3 , tls1 , no_ssl2 , | 5816 | .It Xo |
5580 | .It Fl no_ssl3 , no_tls1 | 5817 | .Fl ssl2 | ssl3 | tls1 | |
5818 | .Fl no_ssl2 | no_ssl3 | no_tls1 | ||
5819 | .Xc | ||
5581 | These options disable the use of certain SSL or TLS protocols. | 5820 | These options disable the use of certain SSL or TLS protocols. |
5582 | By default, the initial handshake uses a method which should be compatible | 5821 | By default, the initial handshake uses a method which should be compatible |
5583 | with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. | 5822 | with all servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. |
@@ -5586,16 +5825,19 @@ There are several known bugs in SSL and TLS implementations. | |||
5586 | Adding this option enables various workarounds. | 5825 | Adding this option enables various workarounds. |
5587 | .It Fl hack | 5826 | .It Fl hack |
5588 | This option enables a further workaround for some some early Netscape | 5827 | This option enables a further workaround for some some early Netscape |
5589 | SSL code (?). | 5828 | SSL code |
5829 | .Pq \&? . | ||
5590 | .It Fl cipher Ar cipherlist | 5830 | .It Fl cipher Ar cipherlist |
5591 | This allows the cipher list used by the server to be modified. | 5831 | This allows the cipher list used by the server to be modified. |
5592 | When the client sends a list of supported ciphers, the first client cipher | 5832 | When the client sends a list of supported ciphers, the first client cipher |
5593 | also included in the server list is used. | 5833 | also included in the server list is used. |
5594 | Because the client specifies the preference order, the order of the server | 5834 | Because the client specifies the preference order, the order of the server |
5595 | cipherlist irrelevant. | 5835 | cipherlist is irrelevant. |
5596 | See the | 5836 | See the |
5597 | .Sx CIPHERS | 5837 | .Sx CIPHERS |
5598 | section for more information. | 5838 | section for more information. |
5839 | .It Fl serverpref | ||
5840 | Use server's cipher preferences. | ||
5599 | .It Fl www | 5841 | .It Fl www |
5600 | Sends a status message back to the client when it connects. | 5842 | Sends a status message back to the client when it connects. |
5601 | This includes lots of information about the ciphers used and various | 5843 | This includes lots of information about the ciphers used and various |
@@ -5632,25 +5874,17 @@ The engine will then be set as the default for all available algorithms. | |||
5632 | .It Fl id_prefix Ar arg | 5874 | .It Fl id_prefix Ar arg |
5633 | Generate SSL/TLS session IDs prefixed by | 5875 | Generate SSL/TLS session IDs prefixed by |
5634 | .Ar arg . | 5876 | .Ar arg . |
5635 | This is mostly useful for testing any SSL/TLS code (e.g. proxies) that wish | 5877 | This is mostly useful for testing any SSL/TLS code |
5636 | to deal with multiple servers, when each of which might be generating a | 5878 | .Pq e.g. proxies |
5637 | unique range of session IDs (e.g. with a certain prefix). | 5879 | that wish to deal with multiple servers, when each of which might be |
5880 | generating a unique range of session IDs | ||
5881 | .Pq e.g. with a certain prefix . | ||
5638 | .It Fl rand Ar file ... | 5882 | .It Fl rand Ar file ... |
5639 | A | 5883 | A file or files containing random data used to seed the random number generator, |
5640 | .Ar file | ||
5641 | or | ||
5642 | .Ar file Ns Li s | ||
5643 | containing random data used to seed the random number generator, | ||
5644 | or an EGD socket (see | 5884 | or an EGD socket (see |
5645 | .Xr RAND_egd 3 ) . | 5885 | .Xr RAND_egd 3 ) . |
5646 | Multiple files can be specified separated by an OS-dependent character. | 5886 | Multiple files can be specified separated by a |
5647 | The separator is | 5887 | .Sq \&: . |
5648 | .Cm \&; | ||
5649 | for MS-Windows, | ||
5650 | .Cm \&, | ||
5651 | for OpenVMS, and | ||
5652 | .Cm \&: | ||
5653 | for all others. | ||
5654 | .El | 5888 | .El |
5655 | .Sh S_SERVER CONNECTED COMMANDS | 5889 | .Sh S_SERVER CONNECTED COMMANDS |
5656 | If a connection request is established with an SSL client and neither the | 5890 | If a connection request is established with an SSL client and neither the |
@@ -5682,13 +5916,14 @@ Print out some session cache status information. | |||
5682 | can be used to debug SSL clients. | 5916 | can be used to debug SSL clients. |
5683 | To accept connections from a web browser the command: | 5917 | To accept connections from a web browser the command: |
5684 | .Pp | 5918 | .Pp |
5685 | \& $ openssl s_server -accept 443 -www | 5919 | .Dl $ openssl s_server -accept 443 -www |
5686 | .Pp | 5920 | .Pp |
5687 | can be used for example. | 5921 | can be used for example. |
5688 | .Pp | 5922 | .Pp |
5689 | Most web browsers (in particular Netscape and MSIE) only support RSA cipher | 5923 | Most web browsers |
5690 | suites, so they cannot connect to servers which don't use a certificate | 5924 | .Pq in particular Netscape and MSIE |
5691 | carrying an RSA key or a version of | 5925 | only support RSA cipher suites, so they cannot connect to servers |
5926 | which don't use a certificate carrying an RSA key or a version of | ||
5692 | .Nm OpenSSL | 5927 | .Nm OpenSSL |
5693 | with RSA disabled. | 5928 | with RSA disabled. |
5694 | .Pp | 5929 | .Pp |
@@ -5721,34 +5956,35 @@ unknown cipher suites a client says it supports. | |||
5721 | .Sh S_TIME | 5956 | .Sh S_TIME |
5722 | The | 5957 | The |
5723 | .Nm s_time | 5958 | .Nm s_time |
5724 | utility is undocumented. | 5959 | utility is currently undocumented. |
5725 | .\" | 5960 | .\" |
5726 | .\" SESS_ID | 5961 | .\" SESS_ID |
5727 | .\" | 5962 | .\" |
5728 | .Sh SESS_ID | 5963 | .Sh SESS_ID |
5729 | .Nm openssl sess_id | 5964 | .Nm openssl sess_id |
5730 | .Bk -words | 5965 | .Bk -words |
5731 | .Op Fl inform Ar PEM|DER | 5966 | .Op Fl inform Ar DER | PEM |
5732 | .Op Fl outform Ar PEM|DER | 5967 | .Op Fl outform Ar DER | PEM |
5733 | .Op Fl in Ar filename | 5968 | .Op Fl in Ar filename |
5734 | .Op Fl out Ar filename | 5969 | .Op Fl out Ar filename |
5735 | .Op Fl text | 5970 | .Op Fl text |
5971 | .Op Fl cert | ||
5736 | .Op Fl noout | 5972 | .Op Fl noout |
5737 | .Op Fl context Ar ID | 5973 | .Op Fl context Ar ID |
5738 | .Ek | 5974 | .Ek |
5739 | .Pp | 5975 | .Pp |
5740 | The | 5976 | The |
5741 | .Nm sess_id | 5977 | .Nm sess_id |
5742 | program processes the encoded version of the SSL | 5978 | program processes the encoded version of the SSL session structure and |
5743 | session structure and optionally prints out SSL | 5979 | optionally prints out SSL session details |
5744 | session details (for example the SSL | 5980 | .Pq for example the SSL session master key |
5745 | session master key) in human readable format. | 5981 | in human readable format. |
5746 | Since this is a diagnostic tool that needs some knowledge of the SSL | 5982 | Since this is a diagnostic tool that needs some knowledge of the SSL |
5747 | protocol to use properly, most users will not need to use it. | 5983 | protocol to use properly, most users will not need to use it. |
5748 | .Pp | 5984 | .Pp |
5749 | The options are as follows: | 5985 | The options are as follows: |
5750 | .Bl -tag -width "XXXX" | 5986 | .Bl -tag -width "XXXX" |
5751 | .It Fl inform Ar DER|PEM | 5987 | .It Fl inform Ar DER | PEM |
5752 | This specifies the input format. | 5988 | This specifies the input format. |
5753 | The | 5989 | The |
5754 | .Ar DER | 5990 | .Ar DER |
@@ -5759,8 +5995,8 @@ The | |||
5759 | .Ar PEM | 5995 | .Ar PEM |
5760 | form is the default format: it consists of the DER | 5996 | form is the default format: it consists of the DER |
5761 | format base64 encoded with additional header and footer lines. | 5997 | format base64 encoded with additional header and footer lines. |
5762 | .It Fl outform Ar DER|PEM | 5998 | .It Fl outform Ar DER | PEM |
5763 | This specifies the output format, the options have the same meaning as the | 5999 | This specifies the output format; the options have the same meaning as the |
5764 | .Fl inform | 6000 | .Fl inform |
5765 | option. | 6001 | option. |
5766 | .It Fl in Ar filename | 6002 | .It Fl in Ar filename |
@@ -5776,14 +6012,15 @@ output if this option is not specified. | |||
5776 | Prints out the various public or private key components in | 6012 | Prints out the various public or private key components in |
5777 | plain text in addition to the encoded version. | 6013 | plain text in addition to the encoded version. |
5778 | .It Fl cert | 6014 | .It Fl cert |
5779 | If a certificate is present in the session it will be output using this option, | 6015 | If a certificate is present in the session, |
6016 | it will be output using this option; | ||
5780 | if the | 6017 | if the |
5781 | .Fl text | 6018 | .Fl text |
5782 | option is also present then it will be printed out in text form. | 6019 | option is also present, then it will be printed out in text form. |
5783 | .It Fl noout | 6020 | .It Fl noout |
5784 | This option prevents output of the encoded version of the session. | 6021 | This option prevents output of the encoded version of the session. |
5785 | .It Fl context Ar ID | 6022 | .It Fl context Ar ID |
5786 | This option can set the session id so the output session information uses the | 6023 | This option can set the session ID so the output session information uses the |
5787 | supplied | 6024 | supplied |
5788 | .Ar ID . | 6025 | .Ar ID . |
5789 | The | 6026 | The |
@@ -5793,7 +6030,7 @@ This option won't normally be used. | |||
5793 | .El | 6030 | .El |
5794 | .Sh SESS_ID OUTPUT | 6031 | .Sh SESS_ID OUTPUT |
5795 | Typical output: | 6032 | Typical output: |
5796 | .Bd -literal | 6033 | .Bd -unfilled |
5797 | \& SSL-Session: | 6034 | \& SSL-Session: |
5798 | \& Protocol : TLSv1 | 6035 | \& Protocol : TLSv1 |
5799 | \& Cipher : 0016 | 6036 | \& Cipher : 0016 |
@@ -5820,10 +6057,11 @@ The session ID context in hex format. | |||
5820 | .It Ar Master-Key | 6057 | .It Ar Master-Key |
5821 | This is the SSL session master key. | 6058 | This is the SSL session master key. |
5822 | .It Ar Key-Arg | 6059 | .It Ar Key-Arg |
5823 | The key argument, this is only used in SSL v2. | 6060 | The key argument; this is only used in SSL v2. |
5824 | .It Ar Start Time | 6061 | .It Ar Start Time |
5825 | This is the session start time, represented as an integer | 6062 | This is the session start time, represented as an integer in standard |
5826 | in standard Unix format. | 6063 | .Ux |
6064 | format. | ||
5827 | .It Ar Timeout | 6065 | .It Ar Timeout |
5828 | The timeout in seconds. | 6066 | The timeout in seconds. |
5829 | .It Ar Verify return code | 6067 | .It Ar Verify return code |
@@ -5833,15 +6071,17 @@ This is the return code when an SSL client certificate is verified. | |||
5833 | The | 6071 | The |
5834 | .Em PEM | 6072 | .Em PEM |
5835 | encoded session format uses the header and footer lines: | 6073 | encoded session format uses the header and footer lines: |
5836 | .Bd -literal | 6074 | .Bd -unfilled -offset indent |
5837 | \& -----BEGIN SSL SESSION PARAMETERS----- | 6075 | -----BEGIN SSL SESSION PARAMETERS----- |
5838 | \& -----END SSL SESSION PARAMETERS----- | 6076 | -----END SSL SESSION PARAMETERS----- |
5839 | .Ed | 6077 | .Ed |
5840 | .Pp | 6078 | .Pp |
5841 | Since the SSL session output contains the master key, it is possible to read | 6079 | Since the SSL session output contains the master key, it is possible to read |
5842 | the contents of an encrypted session using this information. | 6080 | the contents of an encrypted session using this information. |
5843 | Therefore appropriate security precautions | 6081 | Therefore appropriate security precautions |
5844 | should be taken if the information is being output by a "real" application. | 6082 | should be taken if the information is being output by a |
6083 | .Qq real | ||
6084 | application. | ||
5845 | This is, however, strongly discouraged and should only be used for | 6085 | This is, however, strongly discouraged and should only be used for |
5846 | debugging purposes. | 6086 | debugging purposes. |
5847 | .Sh SESS_ID BUGS | 6087 | .Sh SESS_ID BUGS |
@@ -5857,25 +6097,39 @@ The cipher and start time should be printed out in human readable form. | |||
5857 | .Op Fl sign | 6097 | .Op Fl sign |
5858 | .Op Fl verify | 6098 | .Op Fl verify |
5859 | .Op Fl pk7out | 6099 | .Op Fl pk7out |
5860 | .Op Fl des | 6100 | .Oo Xo |
5861 | .Op Fl des3 | 6101 | .Fl des | des3 | rc2-40 | rc2-64 | |
5862 | .Op Fl rc2-40 | 6102 | .Fl rc2-128 | aes128 | aes192 | aes256 |
5863 | .Op Fl rc2-64 | 6103 | .Xc |
5864 | .Op Fl rc2-128 | 6104 | .Oc |
6105 | .Op Fl nointern | ||
6106 | .Op Fl noverify | ||
6107 | .Op Fl nochain | ||
6108 | .Op Fl nosigs | ||
6109 | .Op Fl nocerts | ||
6110 | .Op Fl noattr | ||
6111 | .Op Fl binary | ||
6112 | .Op Fl nodetach | ||
5865 | .Op Fl in Ar file | 6113 | .Op Fl in Ar file |
5866 | .Op Fl certfile Ar file | 6114 | .Op Fl certfile Ar file |
5867 | .Op Fl signer Ar file | 6115 | .Op Fl signer Ar file |
5868 | .Op Fl recip Ar file | 6116 | .Op Fl recip Ar file |
5869 | .Op Fl inform Ar SMIME|PEM|DER | 6117 | .Op Fl inform Ar SMIME | DER | PEM |
5870 | .Op Fl passin Ar arg | 6118 | .Op Fl passin Ar arg |
5871 | .Op Fl inkey Ar file | 6119 | .Op Fl inkey Ar file |
6120 | .Op Fl keyform Ar PEM | ENGINE | ||
5872 | .Op Fl out Ar file | 6121 | .Op Fl out Ar file |
5873 | .Op Fl outform Ar SMIME|PEM|DER | 6122 | .Op Fl outform Ar SMIME | DER | PEM |
5874 | .Op Fl content Ar file | 6123 | .Op Fl content Ar file |
5875 | .Op Fl to Ar addr | 6124 | .Op Fl to Ar addr |
5876 | .Op Fl from Ar addr | 6125 | .Op Fl from Ar addr |
5877 | .Op Fl subject Ar s | 6126 | .Op Fl subject Ar s |
5878 | .Op Fl text | 6127 | .Op Fl text |
6128 | .Op Fl CAfile Ar file | ||
6129 | .Op Fl CApath Ar directory | ||
6130 | .Op Fl crl_check | ||
6131 | .Op Fl crl_check_all | ||
6132 | .Op Fl engine Ar id | ||
5879 | .Op Fl rand Ar file ... | 6133 | .Op Fl rand Ar file ... |
5880 | .Op Ar cert.pem ... | 6134 | .Op Ar cert.pem ... |
5881 | .Ek | 6135 | .Ek |
@@ -5925,7 +6179,7 @@ The input message to be encrypted or signed or the | |||
5925 | .Em MIME | 6179 | .Em MIME |
5926 | message to | 6180 | message to |
5927 | be decrypted or verified. | 6181 | be decrypted or verified. |
5928 | .It Fl inform Ar SMIME|PEM|DER | 6182 | .It Fl inform Ar SMIME | DER | PEM |
5929 | This specifies the input format for the PKCS#7 structure. | 6183 | This specifies the input format for the PKCS#7 structure. |
5930 | The default is | 6184 | The default is |
5931 | .Em SMIME | 6185 | .Em SMIME |
@@ -5938,16 +6192,16 @@ and | |||
5938 | format change this to expect PEM and DER format PKCS#7 structures | 6192 | format change this to expect PEM and DER format PKCS#7 structures |
5939 | instead. | 6193 | instead. |
5940 | This currently only affects the input format of the PKCS#7 | 6194 | This currently only affects the input format of the PKCS#7 |
5941 | structure, if no PKCS#7 structure is being input (for example with | 6195 | structure; if no PKCS#7 structure is being input (for example with |
5942 | .Fl encrypt | 6196 | .Fl encrypt |
5943 | or | 6197 | or |
5944 | .Fl sign ) | 6198 | .Fl sign ) , |
5945 | this option has no effect. | 6199 | this option has no effect. |
5946 | .It Fl out Ar filename | 6200 | .It Fl out Ar filename |
5947 | The message text that has been decrypted or verified, or the output | 6201 | The message text that has been decrypted or verified, or the output |
5948 | .Em MIME | 6202 | .Em MIME |
5949 | format message that has been signed or verified. | 6203 | format message that has been signed or verified. |
5950 | .It Fl outform Ar SMIME|PEM|DER | 6204 | .It Fl outform Ar SMIME | DER | PEM |
5951 | This specifies the output format for the PKCS#7 structure. | 6205 | This specifies the output format for the PKCS#7 structure. |
5952 | The default is | 6206 | The default is |
5953 | .Em SMIME | 6207 | .Em SMIME |
@@ -5978,7 +6232,8 @@ and it uses the multipart/signed | |||
5978 | .Em MIME | 6232 | .Em MIME |
5979 | content type. | 6233 | content type. |
5980 | .It Fl text | 6234 | .It Fl text |
5981 | This option adds plain text (text/plain) | 6235 | This option adds plain text |
6236 | .Pq text/plain | ||
5982 | .Em MIME | 6237 | .Em MIME |
5983 | headers to the supplied message if encrypting or signing. | 6238 | headers to the supplied message if encrypting or signing. |
5984 | If decrypting or verifying it strips off text headers: | 6239 | If decrypting or verifying it strips off text headers: |
@@ -5988,36 +6243,44 @@ type text/plain then an error occurs. | |||
5988 | .It Fl CAfile Ar file | 6243 | .It Fl CAfile Ar file |
5989 | A | 6244 | A |
5990 | .Ar file | 6245 | .Ar file |
5991 | containing trusted CA certificates, only used with | 6246 | containing trusted CA certificates; only used with |
5992 | .Fl verify . | 6247 | .Fl verify . |
5993 | .It Fl CApath Ar dir | 6248 | .It Fl CApath Ar dir |
5994 | A | 6249 | A |
5995 | .Ar directory | 6250 | .Ar directory |
5996 | containing trusted CA certificates, only used with | 6251 | containing trusted CA certificates; only used with |
5997 | .Fl verify . | 6252 | .Fl verify . |
5998 | This directory must be a standard certificate directory; | 6253 | This directory must be a standard certificate directory; |
5999 | that is, a hash of each subject name (using | 6254 | that is, a hash of each subject name (using |
6000 | .Nm x509 -hash ) | 6255 | .Nm x509 -hash ) |
6001 | should be linked to each certificate. | 6256 | should be linked to each certificate. |
6002 | .It Fl des des3 rc2-40 rc2-64 rc2-128 | 6257 | .It Xo |
6258 | .Fl des | des3 | rc2-40 | rc2-64 | | ||
6259 | .Fl rc2-128 | aes128 | aes192 | aes256 | ||
6260 | .Xc | ||
6003 | The encryption algorithm to use. | 6261 | The encryption algorithm to use. |
6004 | DES (56 bits), triple DES\s0 (168 bits) | 6262 | DES |
6005 | or 40, 64 or 128 bit RC2, respectively; if not specified 40 bit RC2 is | 6263 | .Pq 56 bits , |
6264 | triple DES | ||
6265 | .Pq 168 bits , | ||
6266 | 40-, 64-, or 128-bit RC2, or 128-, 192-, or 256-bit AES, respectively; | ||
6267 | if not specified, 40-bit RC2 is | ||
6006 | used. | 6268 | used. |
6007 | Only used with | 6269 | Only used with |
6008 | .Fl encrypt . | 6270 | .Fl encrypt . |
6009 | .It Fl nointern | 6271 | .It Fl nointern |
6010 | When verifying a message, normally certificates (if any) included in | 6272 | When verifying a message, normally certificates |
6011 | the message are searched for the signing certificate. | 6273 | .Pq if any |
6012 | With this option only the certificates specified in the | 6274 | included in the message are searched for the signing certificate. |
6275 | With this option, only the certificates specified in the | ||
6013 | .Fl certfile | 6276 | .Fl certfile |
6014 | option are used. | 6277 | option are used. |
6015 | The supplied certificates can still be used as untrusted CAs however. | 6278 | The supplied certificates can still be used as untrusted CAs however. |
6016 | .It Fl noverify | 6279 | .It Fl noverify |
6017 | Do not verify the signer's certificate of a signed message. | 6280 | Do not verify the signer's certificate of a signed message. |
6018 | .It Fl nochain | 6281 | .It Fl nochain |
6019 | Do not do chain verification of signers' certificates: that is don't | 6282 | Do not do chain verification of signers' certificates: that is, |
6020 | use the certificates in the signed message as untrusted CAs. | 6283 | don't use the certificates in the signed message as untrusted CAs. |
6021 | .It Fl nosigs | 6284 | .It Fl nosigs |
6022 | Don't try to verify the signatures on the message. | 6285 | Don't try to verify the signatures on the message. |
6023 | .It Fl nocerts | 6286 | .It Fl nocerts |
@@ -6032,8 +6295,9 @@ Normally, when a message is signed a set of attributes are included which | |||
6032 | include the signing time and supported symmetric algorithms. | 6295 | include the signing time and supported symmetric algorithms. |
6033 | With this option they are not included. | 6296 | With this option they are not included. |
6034 | .It Fl binary | 6297 | .It Fl binary |
6035 | Normally the input message is converted to "canonical" format which is | 6298 | Normally, the input message is converted to |
6036 | effectively using CR and LF as end of line: as required by the | 6299 | .Qq canonical |
6300 | format which is effectively using CR and LF as end of line: as required by the | ||
6037 | .Em S/MIME | 6301 | .Em S/MIME |
6038 | specification. | 6302 | specification. |
6039 | When this option is present no translation occurs. | 6303 | When this option is present no translation occurs. |
@@ -6066,36 +6330,42 @@ must match one of the recipients of the message or an error occurs. | |||
6066 | .It Fl inkey Ar file | 6330 | .It Fl inkey Ar file |
6067 | The private key to use when signing or decrypting. | 6331 | The private key to use when signing or decrypting. |
6068 | This must match the corresponding certificate. | 6332 | This must match the corresponding certificate. |
6069 | If this option is not specified then the private key must be included | 6333 | If this option is not specified, then the private key must be included |
6070 | in the certificate file specified with | 6334 | in the certificate file specified with |
6071 | the | 6335 | the |
6072 | .Fl recip | 6336 | .Fl recip |
6073 | or | 6337 | or |
6074 | .Fl signer | 6338 | .Fl signer |
6075 | file. | 6339 | file. |
6340 | .It Fl keyform Ar PEM | ENGINE | ||
6341 | Input private key format. | ||
6076 | .It Fl passin Ar arg | 6342 | .It Fl passin Ar arg |
6077 | The private key password source. | 6343 | The private key password source. |
6078 | For more information about the format of | 6344 | For more information about the format of |
6079 | .Ar arg | 6345 | .Ar arg , |
6080 | see the | 6346 | see the |
6081 | .Sx PASS PHRASE ARGUMENTS | 6347 | .Sx PASS PHRASE ARGUMENTS |
6082 | section above. | 6348 | section above. |
6349 | .It Fl crl_check | ||
6350 | Check revocation status of signer's certificate using CRLs. | ||
6351 | .It Fl crl_check_all | ||
6352 | Check revocation status of signer's certificate chain using CRLs. | ||
6353 | .It Fl engine Ar id | ||
6354 | Specifying an engine (by it's unique | ||
6355 | .Ar id | ||
6356 | string) will cause | ||
6357 | .Nm smime | ||
6358 | to attempt to obtain a functional reference to the specified engine, | ||
6359 | thus initialising it if needed. | ||
6360 | The engine will then be set as the default | ||
6361 | for all available algorithms. | ||
6083 | .It Fl rand Ar file ... | 6362 | .It Fl rand Ar file ... |
6084 | A | 6363 | A file or files |
6085 | .Ar file | ||
6086 | or | ||
6087 | .Ar file Ns Li s | ||
6088 | containing random data used to seed the random number generator, | 6364 | containing random data used to seed the random number generator, |
6089 | or an EGD socket (see | 6365 | or an EGD socket (see |
6090 | .Xr RAND_egd 3 ) . | 6366 | .Xr RAND_egd 3 ) . |
6091 | Multiple files can be specified separated by an OS-dependent character. | 6367 | Multiple files can be specified separated by a |
6092 | The separator is | 6368 | .Sq \&: . |
6093 | .Cm \&; | ||
6094 | for MS-Windows, | ||
6095 | .Cm \&, | ||
6096 | for OpenVMS, and | ||
6097 | .Cm \&: | ||
6098 | for all others. | ||
6099 | .It Ar cert.pem ... | 6369 | .It Ar cert.pem ... |
6100 | One or more certificates of message recipients: used when encrypting | 6370 | One or more certificates of message recipients: used when encrypting |
6101 | a message. | 6371 | a message. |
@@ -6122,13 +6392,15 @@ necessary | |||
6122 | .Em MIME | 6392 | .Em MIME |
6123 | headers or many | 6393 | headers or many |
6124 | .Em S/MIME | 6394 | .Em S/MIME |
6125 | clients won't display it properly (if at all). | 6395 | clients won't display it properly |
6396 | .Pq if at all . | ||
6126 | You can use the | 6397 | You can use the |
6127 | .Fl text | 6398 | .Fl text |
6128 | option to automatically add plain text headers. | 6399 | option to automatically add plain text headers. |
6129 | .Pp | 6400 | .Pp |
6130 | A "signed and encrypted" message is one where a signed message is | 6401 | A |
6131 | then encrypted. | 6402 | .Qq signed and encrypted |
6403 | message is one where a signed message is then encrypted. | ||
6132 | This can be produced by encrypting an already signed message: | 6404 | This can be produced by encrypting an already signed message: |
6133 | see the | 6405 | see the |
6134 | .Sx SMIME EXAMPLES | 6406 | .Sx SMIME EXAMPLES |
@@ -6139,8 +6411,9 @@ will verify multiple signers on received messages. | |||
6139 | Some | 6411 | Some |
6140 | .Em S/MIME | 6412 | .Em S/MIME |
6141 | clients choke if a message contains multiple signers. | 6413 | clients choke if a message contains multiple signers. |
6142 | It is possible to sign messages "in parallel" by signing an already | 6414 | It is possible to sign messages |
6143 | signed message. | 6415 | .Qq in parallel |
6416 | by signing an already signed message. | ||
6144 | .Pp | 6417 | .Pp |
6145 | The options | 6418 | The options |
6146 | .Fl encrypt | 6419 | .Fl encrypt |
@@ -6167,56 +6440,58 @@ message. | |||
6167 | An error occurred decrypting or verifying the message. | 6440 | An error occurred decrypting or verifying the message. |
6168 | .It Ar 5 | 6441 | .It Ar 5 |
6169 | The message was verified correctly, but an error occurred writing out | 6442 | The message was verified correctly, but an error occurred writing out |
6170 | the signers certificates. | 6443 | the signer's certificates. |
6171 | .El | 6444 | .El |
6172 | .Sh SMIME EXAMPLES | 6445 | .Sh SMIME EXAMPLES |
6173 | Create a cleartext signed message: | 6446 | Create a cleartext signed message: |
6174 | .Bd -literal | 6447 | .Bd -literal -offset indent |
6175 | \& $ openssl smime -sign -in message.txt -text -out mail.msg \e | 6448 | $ openssl smime -sign -in message.txt -text -out mail.msg \e |
6176 | \& -signer mycert.pem | 6449 | -signer mycert.pem |
6177 | .Ed | 6450 | .Ed |
6178 | .Pp | 6451 | .Pp |
6179 | Create an opaque signed message: | 6452 | Create an opaque signed message: |
6180 | .Bd -literal | 6453 | .Bd -literal -offset indent |
6181 | \& $ openssl smime -sign -in message.txt -text -out mail.msg -nodetach \e | 6454 | $ openssl smime -sign -in message.txt -text -out mail.msg \e |
6182 | \& -signer mycert.pem | 6455 | -nodetach -signer mycert.pem |
6183 | .Ed | 6456 | .Ed |
6184 | .Pp | 6457 | .Pp |
6185 | Create a signed message, include some additional certificates and | 6458 | Create a signed message, include some additional certificates and |
6186 | read the private key from another file: | 6459 | read the private key from another file: |
6187 | .Bd -literal | 6460 | .Bd -literal -offset indent |
6188 | \& $ openssl smime -sign -in in.txt -text -out mail.msg \e | 6461 | $ openssl smime -sign -in in.txt -text -out mail.msg \e |
6189 | \& -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem | 6462 | -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem |
6190 | .Ed | 6463 | .Ed |
6191 | .Pp | 6464 | .Pp |
6192 | Send a signed message under Unix directly to | 6465 | Send a signed message under |
6466 | .Ux | ||
6467 | directly to | ||
6193 | .Xr sendmail 8 , | 6468 | .Xr sendmail 8 , |
6194 | including headers: | 6469 | including headers: |
6195 | .Bd -literal | 6470 | .Bd -literal -offset indent |
6196 | \& $ openssl smime -sign -in in.txt -text -signer mycert.pem \e | 6471 | $ openssl smime -sign -in in.txt -text -signer mycert.pem \e |
6197 | \& -from steve@openssl.org -to someone@somewhere \e | 6472 | -from steve@openssl.org -to someone@somewhere \e |
6198 | \& -subject "Signed message" | sendmail someone@somewhere | 6473 | -subject "Signed message" | sendmail someone@somewhere |
6199 | .Ed | 6474 | .Ed |
6200 | .Pp | 6475 | .Pp |
6201 | Verify a message and extract the signer's certificate if successful: | 6476 | Verify a message and extract the signer's certificate if successful: |
6202 | .Bd -literal | 6477 | .Bd -literal -offset indent |
6203 | \& $ openssl smime -verify -in mail.msg -signer user.pem \e | 6478 | $ openssl smime -verify -in mail.msg -signer user.pem \e |
6204 | \& -out signedtext.txt | 6479 | -out signedtext.txt |
6205 | .Ed | 6480 | .Ed |
6206 | .Pp | 6481 | .Pp |
6207 | Send encrypted mail using triple DES: | 6482 | Send encrypted mail using triple DES: |
6208 | .Bd -literal | 6483 | .Bd -literal -offset indent |
6209 | \& $ openssl smime -encrypt -in in.txt -from steve@openssl.org \e | 6484 | $ openssl smime -encrypt -in in.txt -from steve@openssl.org \e |
6210 | \& -to someone@somewhere -subject "Encrypted message" \e | 6485 | -to someone@somewhere -subject "Encrypted message" \e |
6211 | \& -des3 user.pem -out mail.msg | 6486 | -des3 user.pem -out mail.msg |
6212 | .Ed | 6487 | .Ed |
6213 | .Pp | 6488 | .Pp |
6214 | Sign and encrypt mail: | 6489 | Sign and encrypt mail: |
6215 | .Bd -literal | 6490 | .Bd -literal -offset indent |
6216 | \& $ openssl smime -sign -in ml.txt -signer my.pem -text \e | 6491 | $ openssl smime -sign -in ml.txt -signer my.pem -text | \e |
6217 | \& | openssl smime -encrypt -out mail.msg \e | 6492 | openssl smime -encrypt -out mail.msg \e |
6218 | \& -from steve@openssl.org -to someone@somewhere \e | 6493 | -from steve@openssl.org -to someone@somewhere \e |
6219 | \& -subject "Signed and Encrypted message" -des3 user.pem | 6494 | -subject "Signed and Encrypted message" -des3 user.pem |
6220 | .Ed | 6495 | .Ed |
6221 | .Pp | 6496 | .Pp |
6222 | .Sy Note : | 6497 | .Sy Note : |
@@ -6227,28 +6502,30 @@ option because the message being encrypted already has | |||
6227 | headers. | 6502 | headers. |
6228 | .Pp | 6503 | .Pp |
6229 | Decrypt mail: | 6504 | Decrypt mail: |
6230 | .Pp | 6505 | .Bd -literal -offset indent |
6231 | \& $ openssl smime -decrypt -in mail.msg -recip mycert.pem -inkey key.pem | 6506 | $ openssl smime -decrypt -in mail.msg -recip mycert.pem \e |
6507 | -inkey key.pem" | ||
6508 | .Ed | ||
6232 | .Pp | 6509 | .Pp |
6233 | The output from Netscape form signing is a PKCS#7 structure with the | 6510 | The output from Netscape form signing is a PKCS#7 structure with the |
6234 | detached signature format. | 6511 | detached signature format. |
6235 | You can use this program to verify the signature by line wrapping the | 6512 | You can use this program to verify the signature by line wrapping the |
6236 | base64 encoded structure and surrounding it with: | 6513 | base64 encoded structure and surrounding it with: |
6237 | .Bd -literal | 6514 | .Bd -unfilled -offset indent |
6238 | \& -----BEGIN PKCS7----- | 6515 | -----BEGIN PKCS7----- |
6239 | \& -----END PKCS7----- | 6516 | -----END PKCS7----- |
6240 | .Ed | 6517 | .Ed |
6241 | .Pp | 6518 | .Pp |
6242 | and using the command: | 6519 | and using the command: |
6243 | .Bd -literal | 6520 | .Bd -literal -offset indent |
6244 | \& $ openssl smime -verify -inform PEM -in signature.pem | 6521 | $ openssl smime -verify -inform PEM -in signature.pem \e |
6245 | \& -content content.txt | 6522 | -content content.txt |
6246 | .Ed | 6523 | .Ed |
6247 | .Pp | 6524 | .Pp |
6248 | Alternatively, you can base64 decode the signature and use: | 6525 | Alternatively, you can base64 decode the signature and use: |
6249 | .Bd -literal | 6526 | .Bd -literal -offset indent |
6250 | \& $ openssl smime -verify -inform DER -in signature.der | 6527 | $ openssl smime -verify -inform DER -in signature.der \e |
6251 | \& -content content.txt | 6528 | -content content.txt |
6252 | .Ed | 6529 | .Ed |
6253 | .Sh SMIME BUGS | 6530 | .Sh SMIME BUGS |
6254 | The | 6531 | The |
@@ -6262,7 +6539,7 @@ extracted. | |||
6262 | There should be some heuristic that determines the correct encryption | 6539 | There should be some heuristic that determines the correct encryption |
6263 | certificate. | 6540 | certificate. |
6264 | .Pp | 6541 | .Pp |
6265 | Ideally a database should be maintained of a certificate for each email | 6542 | Ideally, a database should be maintained of a certificate for each email |
6266 | address. | 6543 | address. |
6267 | .Pp | 6544 | .Pp |
6268 | The code doesn't currently take note of the permitted symmetric encryption | 6545 | The code doesn't currently take note of the permitted symmetric encryption |
@@ -6276,7 +6553,7 @@ No revocation checking is done on the signer's certificate. | |||
6276 | .Pp | 6553 | .Pp |
6277 | The current code can only handle | 6554 | The current code can only handle |
6278 | .Em S/MIME | 6555 | .Em S/MIME |
6279 | v2 messages, the more complex | 6556 | v2 messages; the more complex |
6280 | .Em S/MIME | 6557 | .Em S/MIME |
6281 | v3 structures may cause parsing errors. | 6558 | v3 structures may cause parsing errors. |
6282 | .\" | 6559 | .\" |
@@ -6284,37 +6561,63 @@ v3 structures may cause parsing errors. | |||
6284 | .\" | 6561 | .\" |
6285 | .Sh SPEED | 6562 | .Sh SPEED |
6286 | .Nm openssl speed | 6563 | .Nm openssl speed |
6287 | .Op Fl engine Ar id | 6564 | .Bk -words |
6288 | .Op Cm md2 | 6565 | .Op Cm aes |
6289 | .Op Cm mdc2 | 6566 | .Op Cm aes-128-cbc |
6290 | .Op Cm md5 | 6567 | .Op Cm aes-192-cbc |
6291 | .Op Cm hmac | 6568 | .Op Cm aes-256-cbc |
6292 | .Op Cm sha1 | 6569 | .Op Cm blowfish |
6293 | .Op Cm rmd160 | ||
6294 | .Op Cm idea-cbc | ||
6295 | .Op Cm rc2-cbc | ||
6296 | .Op Cm rc5-cbc | ||
6297 | .Op Cm bf-cbc | 6570 | .Op Cm bf-cbc |
6571 | .Op Cm des | ||
6298 | .Op Cm des-cbc | 6572 | .Op Cm des-cbc |
6299 | .Op Cm des-ede3 | 6573 | .Op Cm des-ede3 |
6300 | .Op Cm rc4 | ||
6301 | .Op Cm rsa512 | ||
6302 | .Op Cm rsa1024 | ||
6303 | .Op Cm rsa2048 | ||
6304 | .Op Cm rsa4096 | ||
6305 | .Op Cm dsa512 | 6574 | .Op Cm dsa512 |
6306 | .Op Cm dsa1024 | 6575 | .Op Cm dsa1024 |
6307 | .Op Cm dsa2048 | 6576 | .Op Cm dsa2048 |
6308 | .Op Cm idea | 6577 | .Op Cm hmac |
6578 | .Op Cm md2 | ||
6579 | .Op Cm md4 | ||
6580 | .Op Cm md5 | ||
6309 | .Op Cm rc2 | 6581 | .Op Cm rc2 |
6310 | .Op Cm des | 6582 | .Op Cm rc2-cbc |
6583 | .Op Cm rc4 | ||
6584 | .Op Cm rmd160 | ||
6311 | .Op Cm rsa | 6585 | .Op Cm rsa |
6312 | .Op Cm blowfish | 6586 | .Op Cm rsa512 |
6587 | .Op Cm rsa1024 | ||
6588 | .Op Cm rsa2048 | ||
6589 | .Op Cm rsa4096 | ||
6590 | .Op Cm sha1 | ||
6591 | .Op Fl elapsed | ||
6592 | .Op Fl evp Ar e | ||
6593 | .Op Fl decrypt | ||
6594 | .Op Fl mr | ||
6595 | .Op Fl multi Ar number | ||
6596 | .Op Fl engine Ar id | ||
6597 | .Ek | ||
6313 | .Pp | 6598 | .Pp |
6314 | The | 6599 | The |
6315 | .Nm speed | 6600 | .Nm speed |
6316 | command is used to test the performance of cryptographic algorithms. | 6601 | command is used to test the performance of cryptographic algorithms. |
6317 | .Bl -tag -width "XXXX" | 6602 | .Bl -tag -width "XXXX" |
6603 | .It Cm [zero or more test algorithms] | ||
6604 | If any options are given, | ||
6605 | .Nm speed | ||
6606 | tests those algorithms, otherwise all of the above are tested. | ||
6607 | .It Fl elapsed | ||
6608 | Measure time in real time instead of CPU user time. | ||
6609 | .It Fl evp Ar e | ||
6610 | Use EVP | ||
6611 | .Ar e . | ||
6612 | .It Fl decrypt | ||
6613 | Time decryption instead of encryption | ||
6614 | .Pq only EVP . | ||
6615 | .It Fl mr | ||
6616 | Produce machine readable ouput. | ||
6617 | .It Fl multi Ar number | ||
6618 | Run | ||
6619 | .Ar number | ||
6620 | benchmarks in parallel. | ||
6318 | .It Fl engine Ar id | 6621 | .It Fl engine Ar id |
6319 | Specifying an engine (by it's unique | 6622 | Specifying an engine (by it's unique |
6320 | .Ar id | 6623 | .Ar id |
@@ -6324,10 +6627,6 @@ to attempt to obtain a functional reference to the specified engine, | |||
6324 | thus initialising it if needed. | 6627 | thus initialising it if needed. |
6325 | The engine will then be set as the default | 6628 | The engine will then be set as the default |
6326 | for all available algorithms. | 6629 | for all available algorithms. |
6327 | .It Cm [zero or more test algorithms] | ||
6328 | If any options are given, | ||
6329 | .Nm speed | ||
6330 | tests those algorithms, otherwise all of the above are tested. | ||
6331 | .El | 6630 | .El |
6332 | .\" | 6631 | .\" |
6333 | .\" SPKAC | 6632 | .\" SPKAC |
@@ -6349,7 +6648,8 @@ tests those algorithms, otherwise all of the above are tested. | |||
6349 | The | 6648 | The |
6350 | .Nm spkac | 6649 | .Nm spkac |
6351 | command processes Netscape signed public key and challenge | 6650 | command processes Netscape signed public key and challenge |
6352 | (SPKAC) files. | 6651 | .Pq SPKAC |
6652 | files. | ||
6353 | It can print out their contents, verify the signature and | 6653 | It can print out their contents, verify the signature and |
6354 | produce its own SPKACs from a supplied private key. | 6654 | produce its own SPKACs from a supplied private key. |
6355 | .Pp | 6655 | .Pp |
@@ -6377,7 +6677,7 @@ options are ignored if present. | |||
6377 | .It Fl passin Ar password | 6677 | .It Fl passin Ar password |
6378 | The input file password source. | 6678 | The input file password source. |
6379 | For more information about the format of | 6679 | For more information about the format of |
6380 | .Ar arg | 6680 | .Ar arg , |
6381 | see the | 6681 | see the |
6382 | .Sx PASS PHRASE ARGUMENTS | 6682 | .Sx PASS PHRASE ARGUMENTS |
6383 | section above. | 6683 | section above. |
@@ -6393,18 +6693,18 @@ Allows an alternative name for the | |||
6393 | containing the SPKAC. | 6693 | containing the SPKAC. |
6394 | The default is the default section. | 6694 | The default is the default section. |
6395 | .It Fl noout | 6695 | .It Fl noout |
6396 | Don't output the text version of the SPKAC (not used if an | 6696 | Don't output the text version of the SPKAC |
6397 | SPKAC is being created). | 6697 | .Pq not used if an SPKAC is being created . |
6398 | .It Fl pubkey | 6698 | .It Fl pubkey |
6399 | Output the public key of an SPKAC (not used if an SPKAC is | 6699 | Output the public key of an SPKAC |
6400 | being created). | 6700 | .Pq not used if an SPKAC is being created . |
6401 | .It Fl verify | 6701 | .It Fl verify |
6402 | Verifies the digital signature on the supplied SPKAC. | 6702 | Verifies the digital signature on the supplied SPKAC. |
6403 | .It Fl engine Ar id | 6703 | .It Fl engine Ar id |
6404 | Specifying an engine (by it's unique | 6704 | Specifying an engine (by it's unique |
6405 | .Ar id | 6705 | .Ar id |
6406 | string) will cause | 6706 | string) will cause |
6407 | .Nm req | 6707 | .Nm spkac |
6408 | to attempt to obtain a functional reference to the specified engine, | 6708 | to attempt to obtain a functional reference to the specified engine, |
6409 | thus initialising it if needed. | 6709 | thus initialising it if needed. |
6410 | The engine will then be set as the default for all available algorithms. | 6710 | The engine will then be set as the default for all available algorithms. |
@@ -6412,23 +6712,25 @@ The engine will then be set as the default for all available algorithms. | |||
6412 | .Sh SPKAC EXAMPLES | 6712 | .Sh SPKAC EXAMPLES |
6413 | Print out the contents of an SPKAC: | 6713 | Print out the contents of an SPKAC: |
6414 | .Pp | 6714 | .Pp |
6415 | \& $ openssl spkac -in spkac.cnf | 6715 | .Dl $ openssl spkac -in spkac.cnf |
6416 | .Pp | 6716 | .Pp |
6417 | Verify the signature of an SPKAC: | 6717 | Verify the signature of an SPKAC: |
6418 | .Pp | 6718 | .Pp |
6419 | \& $ openssl spkac -in spkac.cnf -noout -verify | 6719 | .Dl $ openssl spkac -in spkac.cnf -noout -verify |
6420 | .Pp | 6720 | .Pp |
6421 | Create an SPKAC using the challenge string "hello": | 6721 | Create an SPKAC using the challenge string |
6722 | .Qq hello : | ||
6422 | .Pp | 6723 | .Pp |
6423 | \& $ openssl spkac -key key.pem -challenge hello -out spkac.cnf | 6724 | .Dl $ openssl spkac -key key.pem -challenge hello -out spkac.cnf |
6424 | .Pp | 6725 | .Pp |
6425 | Example of an SPKAC, (long lines split up for clarity): | 6726 | Example of an SPKAC, |
6426 | .Bd -literal | 6727 | .Pq long lines split up for clarity : |
6427 | \& SPKAC=MIG5MGUwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA1cCoq2Wa3Ixs47uI7F\e | 6728 | .Bd -unfilled -offset indent |
6428 | \& PVwHVIPDx5yso105Y6zpozam135a8R0CpoRvkkigIyXfcCjiVi5oWk+6FfPaD03u\e | 6729 | SPKAC=MIG5MGUwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA1cCoq2Wa3Ixs47uI7F\e |
6429 | \& PFoQIDAQABFgVoZWxsbzANBgkqhkiG9w0BAQQFAANBAFpQtY/FojdwkJh1bEIYuc\e | 6730 | PVwHVIPDx5yso105Y6zpozam135a8R0CpoRvkkigIyXfcCjiVi5oWk+6FfPaD03u\e |
6430 | \& 2EeM2KHTWPEepWYeawvHD0gQ3DngSC75YCWnnDdq+NQ3F+X4deMx9AaEglZtULwV\e | 6731 | PFoQIDAQABFgVoZWxsbzANBgkqhkiG9w0BAQQFAANBAFpQtY/FojdwkJh1bEIYuc\e |
6431 | \& 4= | 6732 | 2EeM2KHTWPEepWYeawvHD0gQ3DngSC75YCWnnDdq+NQ3F+X4deMx9AaEglZtULwV\e |
6733 | 4= | ||
6432 | .Ed | 6734 | .Ed |
6433 | .Sh SPKAC NOTES | 6735 | .Sh SPKAC NOTES |
6434 | A created SPKAC with suitable DN components appended can be fed into | 6736 | A created SPKAC with suitable DN components appended can be fed into |
@@ -6448,7 +6750,8 @@ string, some guarantee is given that the user knows the private key | |||
6448 | corresponding to the public key being certified. | 6750 | corresponding to the public key being certified. |
6449 | This is important in some applications. | 6751 | This is important in some applications. |
6450 | Without this it is possible for a previous SPKAC | 6752 | Without this it is possible for a previous SPKAC |
6451 | to be used in a "replay attack". | 6753 | to be used in a |
6754 | .Qq replay attack . | ||
6452 | .\" | 6755 | .\" |
6453 | .\" VERIFY | 6756 | .\" VERIFY |
6454 | .\" | 6757 | .\" |
@@ -6461,6 +6764,8 @@ to be used in a "replay attack". | |||
6461 | .Op Fl help | 6764 | .Op Fl help |
6462 | .Op Fl issuer_checks | 6765 | .Op Fl issuer_checks |
6463 | .Op Fl verbose | 6766 | .Op Fl verbose |
6767 | .Op Fl crl_check | ||
6768 | .Op Fl engine Ar id | ||
6464 | .Op Fl | 6769 | .Op Fl |
6465 | .Op Ar certificates | 6770 | .Op Ar certificates |
6466 | .Pp | 6771 | .Pp |
@@ -6476,13 +6781,15 @@ A | |||
6476 | of trusted certificates. | 6781 | of trusted certificates. |
6477 | The certificates should have names of the form | 6782 | The certificates should have names of the form |
6478 | .Em hash.0 , | 6783 | .Em hash.0 , |
6479 | or have symbolic links to them of this form. | 6784 | or have symbolic links to them of this form |
6480 | ("hash" is the hashed certificate subject name: see the | 6785 | ("hash" is the hashed certificate subject name: see the |
6481 | .Fl hash | 6786 | .Fl hash |
6482 | option of the | 6787 | option of the |
6483 | .Nm x509 | 6788 | .Nm x509 |
6484 | utility). | 6789 | utility). |
6485 | Under Unix the | 6790 | Under |
6791 | .Ux , | ||
6792 | the | ||
6486 | .Nm c_rehash | 6793 | .Nm c_rehash |
6487 | script will automatically create symbolic links to a directory of certificates. | 6794 | script will automatically create symbolic links to a directory of certificates. |
6488 | .It Fl CAfile Ar file | 6795 | .It Fl CAfile Ar file |
@@ -6523,16 +6830,26 @@ This shows why each candidate issuer certificate was rejected. | |||
6523 | However the presence of rejection messages | 6830 | However the presence of rejection messages |
6524 | does not itself imply that anything is wrong: during the normal | 6831 | does not itself imply that anything is wrong: during the normal |
6525 | verify process several rejections may take place. | 6832 | verify process several rejections may take place. |
6833 | .It Fl crl_check | ||
6834 | Check revocation status of signer's certificate using CRLs. | ||
6835 | .It Fl engine Ar id | ||
6836 | Specifying an engine (by it's unique | ||
6837 | .Ar id | ||
6838 | string) will cause | ||
6839 | .Nm verify | ||
6840 | to attempt to obtain a functional reference to the specified engine, | ||
6841 | thus initialising it if needed. | ||
6842 | The engine will then be set as the default for all available algorithms. | ||
6526 | .It Fl | 6843 | .It Fl |
6527 | Marks the last option. | 6844 | Marks the last option. |
6528 | All arguments following this are assumed to be certificate files. | 6845 | All arguments following this are assumed to be certificate files. |
6529 | This is useful if the first certificate filename begins with a | 6846 | This is useful if the first certificate filename begins with a |
6530 | .Cm \&- . | 6847 | .Sq - . |
6531 | .It Ar certificates | 6848 | .It Ar certificates |
6532 | One or more | 6849 | One or more |
6533 | .Ar certificates | 6850 | .Ar certificates |
6534 | to verify. | 6851 | to verify. |
6535 | If no certificate filenames are included then an attempt is made to read | 6852 | If no certificate filenames are included, then an attempt is made to read |
6536 | a certificate from standard input. | 6853 | a certificate from standard input. |
6537 | They should all be in | 6854 | They should all be in |
6538 | .Em PEM | 6855 | .Em PEM |
@@ -6559,11 +6876,12 @@ and ending in the root CA. | |||
6559 | It is an error if the whole chain cannot be built up. | 6876 | It is an error if the whole chain cannot be built up. |
6560 | The chain is built up by looking up the issuers certificate of the current | 6877 | The chain is built up by looking up the issuers certificate of the current |
6561 | certificate. | 6878 | certificate. |
6562 | If a certificate is found which is its own issuer it is assumed | 6879 | If a certificate is found which is its own issuer, it is assumed |
6563 | to be the root CA. | 6880 | to be the root CA. |
6564 | .Pp | 6881 | .Pp |
6565 | The process of 'looking up the issuers certificate' itself involves a number | 6882 | The process of |
6566 | of steps. | 6883 | .Qq looking up the issuers certificate |
6884 | itself involves a number of steps. | ||
6567 | In versions of | 6885 | In versions of |
6568 | .Nm OpenSSL | 6886 | .Nm OpenSSL |
6569 | before 0.9.5a the first certificate whose subject name matched the issuer | 6887 | before 0.9.5a the first certificate whose subject name matched the issuer |
@@ -6573,10 +6891,14 @@ In | |||
6573 | 0.9.6 and later all certificates whose subject name matches the issuer name | 6891 | 0.9.6 and later all certificates whose subject name matches the issuer name |
6574 | of the current certificate are subject to further tests. | 6892 | of the current certificate are subject to further tests. |
6575 | The relevant authority key identifier components of the current certificate | 6893 | The relevant authority key identifier components of the current certificate |
6576 | (if present) must match the subject key identifier (if present) | 6894 | .Pq if present |
6895 | must match the subject key identifier | ||
6896 | .Pq if present | ||
6577 | and issuer and serial number of the candidate issuer; in addition the | 6897 | and issuer and serial number of the candidate issuer; in addition the |
6578 | .Em keyUsage | 6898 | .Em keyUsage |
6579 | extension of the candidate issuer (if present) must permit certificate signing. | 6899 | extension of the candidate issuer |
6900 | .Pq if present | ||
6901 | must permit certificate signing. | ||
6580 | .Pp | 6902 | .Pp |
6581 | The lookup first looks in the list of untrusted certificates and if no match | 6903 | The lookup first looks in the list of untrusted certificates and if no match |
6582 | is found the remaining lookups are from the trusted certificates. | 6904 | is found the remaining lookups are from the trusted certificates. |
@@ -6589,9 +6911,10 @@ consistency with the supplied purpose. | |||
6589 | If the | 6911 | If the |
6590 | .Fl purpose | 6912 | .Fl purpose |
6591 | option is not included, then no checks are done. | 6913 | option is not included, then no checks are done. |
6592 | The supplied or "leaf" certificate must have extensions compatible with the | 6914 | The supplied or |
6593 | supplied purpose and all other certificates must also be valid | 6915 | .Qq leaf |
6594 | CA certificates. | 6916 | certificate must have extensions compatible with the supplied purpose |
6917 | and all other certificates must also be valid CA certificates. | ||
6595 | The precise extensions required are described in more detail in | 6918 | The precise extensions required are described in more detail in |
6596 | the | 6919 | the |
6597 | .Sx X509 CERTIFICATE EXTENSIONS | 6920 | .Sx X509 CERTIFICATE EXTENSIONS |
@@ -6620,15 +6943,15 @@ If any operation fails then the certificate is not valid. | |||
6620 | .Sh VERIFY DIAGNOSTICS | 6943 | .Sh VERIFY DIAGNOSTICS |
6621 | When a verify operation fails, the output messages can be somewhat cryptic. | 6944 | When a verify operation fails, the output messages can be somewhat cryptic. |
6622 | The general form of the error message is: | 6945 | The general form of the error message is: |
6623 | .Bd -literal | 6946 | .Bd -unfilled |
6624 | \& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | 6947 | \& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit) |
6625 | \& error 24 at 1 depth lookup:invalid CA certificate | 6948 | \& error 24 at 1 depth lookup:invalid CA certificate |
6626 | .Ed | 6949 | .Ed |
6627 | .Pp | 6950 | .Pp |
6628 | The first line contains the name of the certificate being verified followed by | 6951 | The first line contains the name of the certificate being verified, followed by |
6629 | the subject name of the certificate. | 6952 | the subject name of the certificate. |
6630 | The second line contains the error number and the depth. | 6953 | The second line contains the error number and the depth. |
6631 | The depth is number of the certificate being verified when a | 6954 | The depth is the number of the certificate being verified when a |
6632 | problem was detected starting with zero for the certificate being verified | 6955 | problem was detected starting with zero for the certificate being verified |
6633 | itself, then 1 for the CA that signed the certificate and so on. | 6956 | itself, then 1 for the CA that signed the certificate and so on. |
6634 | Finally a text version of the error number is presented. | 6957 | Finally a text version of the error number is presented. |
@@ -6637,7 +6960,8 @@ An exhaustive list of the error codes and messages is shown below; this also | |||
6637 | includes the name of the error code as defined in the header file | 6960 | includes the name of the error code as defined in the header file |
6638 | .Aq Pa x509_vfy.h . | 6961 | .Aq Pa x509_vfy.h . |
6639 | Some of the error codes are defined but never returned: these are described | 6962 | Some of the error codes are defined but never returned: these are described |
6640 | as "unused". | 6963 | as |
6964 | .Qq unused . | ||
6641 | .Bl -tag -width "XXXX" | 6965 | .Bl -tag -width "XXXX" |
6642 | .It Ar "0 X509_V_OK: ok" | 6966 | .It Ar "0 X509_V_OK: ok" |
6643 | The operation was successful. | 6967 | The operation was successful. |
@@ -6782,12 +7106,7 @@ mishandled them. | |||
6782 | .\" | 7106 | .\" |
6783 | .Sh VERSION | 7107 | .Sh VERSION |
6784 | .Nm openssl version | 7108 | .Nm openssl version |
6785 | .Op Fl a | 7109 | .Op Fl abdfopv |
6786 | .Op Fl v | ||
6787 | .Op Fl b | ||
6788 | .Op Fl o | ||
6789 | .Op Fl f | ||
6790 | .Op Fl p | ||
6791 | .Pp | 7110 | .Pp |
6792 | The | 7111 | The |
6793 | .Nm version | 7112 | .Nm version |
@@ -6798,23 +7117,23 @@ The options are as follows: | |||
6798 | .Bl -tag -width "XXXX" | 7117 | .Bl -tag -width "XXXX" |
6799 | .It Fl a | 7118 | .It Fl a |
6800 | All information: this is the same as setting all the other flags. | 7119 | All information: this is the same as setting all the other flags. |
6801 | .It Fl v | ||
6802 | The current | ||
6803 | .Nm OpenSSL | ||
6804 | version. | ||
6805 | .It Fl b | 7120 | .It Fl b |
6806 | The date the current version of | 7121 | The date the current version of |
6807 | .Nm OpenSSL | 7122 | .Nm OpenSSL |
6808 | was built. | 7123 | was built. |
7124 | .It Fl d | ||
7125 | .Ev OPENSSLDIR | ||
7126 | setting. | ||
7127 | .It Fl f | ||
7128 | Compilation flags. | ||
6809 | .It Fl o | 7129 | .It Fl o |
6810 | Option information: various options set when the library was built. | 7130 | Option information: various options set when the library was built. |
6811 | .It Fl c | ||
6812 | Compilation flags. | ||
6813 | .It Fl p | 7131 | .It Fl p |
6814 | Platform setting. | 7132 | Platform setting. |
6815 | .It Fl d | 7133 | .It Fl v |
6816 | .Em OPENSSLDIR | 7134 | The current |
6817 | setting. | 7135 | .Nm OpenSSL |
7136 | version. | ||
6818 | .El | 7137 | .El |
6819 | .Sh VERSION NOTES | 7138 | .Sh VERSION NOTES |
6820 | The output of | 7139 | The output of |
@@ -6832,13 +7151,14 @@ option was added in | |||
6832 | .Sh X509 | 7151 | .Sh X509 |
6833 | .Nm openssl x509 | 7152 | .Nm openssl x509 |
6834 | .Bk -words | 7153 | .Bk -words |
6835 | .Op Fl inform Ar DER|PEM|NET | 7154 | .Op Fl inform Ar DER | PEM | NET |
6836 | .Op Fl outform Ar DER|PEM|NET | 7155 | .Op Fl outform Ar DER | PEM | NET |
6837 | .Op Fl keyform Ar DER|PEM | 7156 | .Op Fl keyform Ar DER | PEM |
6838 | .Op Fl CAform Ar DER|PEM | 7157 | .Op Fl CAform Ar DER | PEM |
6839 | .Op Fl CAkeyform Ar DER|PEM | 7158 | .Op Fl CAkeyform Ar DER | PEM |
6840 | .Op Fl in Ar filename | 7159 | .Op Fl in Ar filename |
6841 | .Op Fl out Ar filename | 7160 | .Op Fl out Ar filename |
7161 | .Op Fl passin Ar arg | ||
6842 | .Op Fl serial | 7162 | .Op Fl serial |
6843 | .Op Fl hash | 7163 | .Op Fl hash |
6844 | .Op Fl subject | 7164 | .Op Fl subject |
@@ -6850,9 +7170,11 @@ option was added in | |||
6850 | .Op Fl purpose | 7170 | .Op Fl purpose |
6851 | .Op Fl dates | 7171 | .Op Fl dates |
6852 | .Op Fl modulus | 7172 | .Op Fl modulus |
7173 | .Op Fl pubkey | ||
6853 | .Op Fl fingerprint | 7174 | .Op Fl fingerprint |
6854 | .Op Fl alias | 7175 | .Op Fl alias |
6855 | .Op Fl noout | 7176 | .Op Fl noout |
7177 | .Op Fl ocspid | ||
6856 | .Op Fl trustout | 7178 | .Op Fl trustout |
6857 | .Op Fl clrtrust | 7179 | .Op Fl clrtrust |
6858 | .Op Fl clrreject | 7180 | .Op Fl clrreject |
@@ -6860,6 +7182,7 @@ option was added in | |||
6860 | .Op Fl addreject Ar arg | 7182 | .Op Fl addreject Ar arg |
6861 | .Op Fl setalias Ar arg | 7183 | .Op Fl setalias Ar arg |
6862 | .Op Fl days Ar arg | 7184 | .Op Fl days Ar arg |
7185 | .Op Fl checkend Ar arg | ||
6863 | .Op Fl set_serial Ar n | 7186 | .Op Fl set_serial Ar n |
6864 | .Op Fl signkey Ar filename | 7187 | .Op Fl signkey Ar filename |
6865 | .Op Fl x509toreq | 7188 | .Op Fl x509toreq |
@@ -6870,7 +7193,7 @@ option was added in | |||
6870 | .Op Fl CAserial Ar filename | 7193 | .Op Fl CAserial Ar filename |
6871 | .Op Fl text | 7194 | .Op Fl text |
6872 | .Op Fl C | 7195 | .Op Fl C |
6873 | .Op Cm -md2|-md5|-sha1|-mdc2 | 7196 | .Op Fl md2 | md5 | sha1 |
6874 | .Op Fl clrext | 7197 | .Op Fl clrext |
6875 | .Op Fl extfile Ar filename | 7198 | .Op Fl extfile Ar filename |
6876 | .Op Fl extensions Ar section | 7199 | .Op Fl extensions Ar section |
@@ -6881,16 +7204,17 @@ The | |||
6881 | .Nm x509 | 7204 | .Nm x509 |
6882 | command is a multi-purpose certificate utility. | 7205 | command is a multi-purpose certificate utility. |
6883 | It can be used to display certificate information, convert certificates to | 7206 | It can be used to display certificate information, convert certificates to |
6884 | various forms, sign certificate requests like a "mini CA" or edit | 7207 | various forms, sign certificate requests like a |
6885 | certificate trust settings. | 7208 | .Qq mini CA , |
7209 | or edit certificate trust settings. | ||
6886 | .Pp | 7210 | .Pp |
6887 | Since there are a large number of options, they are split up into | 7211 | Since there are a large number of options, they are split up into |
6888 | various sections. | 7212 | various sections. |
6889 | .Sh X509 INPUT, OUTPUT AND GENERAL PURPOSE OPTIONS | 7213 | .Sh X509 INPUT, OUTPUT, AND GENERAL PURPOSE OPTIONS |
6890 | .Bl -tag -width "XXXX" | 7214 | .Bl -tag -width "XXXX" |
6891 | .It Fl inform Ar DER|PEM|NET | 7215 | .It Fl inform Ar DER | PEM | NET |
6892 | This specifies the input format. | 7216 | This specifies the input format. |
6893 | Normally the command will expect an X509 certificate, | 7217 | Normally, the command will expect an X509 certificate, |
6894 | but this can change if other options such as | 7218 | but this can change if other options such as |
6895 | .Fl req | 7219 | .Fl req |
6896 | are present. | 7220 | are present. |
@@ -6903,9 +7227,8 @@ The | |||
6903 | .Ar NET | 7227 | .Ar NET |
6904 | option is an obscure Netscape server format that is now | 7228 | option is an obscure Netscape server format that is now |
6905 | obsolete. | 7229 | obsolete. |
6906 | .It Fl outform Ar DER|PEM|NET | 7230 | .It Fl outform Ar DER | PEM | NET |
6907 | This specifies the output format; | 7231 | This specifies the output format; the options have the same meaning as the |
6908 | the options have the same meaning as the | ||
6909 | .Fl inform | 7232 | .Fl inform |
6910 | option. | 7233 | option. |
6911 | .It Fl in Ar filename | 7234 | .It Fl in Ar filename |
@@ -6916,22 +7239,29 @@ to read a certificate from or standard input if this option is not specified. | |||
6916 | This specifies the output | 7239 | This specifies the output |
6917 | .Ar filename | 7240 | .Ar filename |
6918 | to write to or standard output by default. | 7241 | to write to or standard output by default. |
6919 | .It Fl md2|-md5|-sha1|-mdc2 | 7242 | .It Fl passin Ar arg |
7243 | The key password source. | ||
7244 | For more information about the format of | ||
7245 | .Ar arg , | ||
7246 | see the | ||
7247 | .Sx PASS PHRASE ARGUMENTS | ||
7248 | section above. | ||
7249 | .It Fl md2 | md5 | sha1 | ||
6920 | The digest to use. | 7250 | The digest to use. |
6921 | This affects any signing or display option that uses a message digest, | 7251 | This affects any signing or display option that uses a message digest, |
6922 | such as the | 7252 | such as the |
6923 | .Fl fingerprint , signkey | 7253 | .Fl fingerprint , signkey , |
6924 | and | 7254 | and |
6925 | .Fl CA | 7255 | .Fl CA |
6926 | options. | 7256 | options. |
6927 | If not specified then MD5 is used. | 7257 | If not specified, then MD5 is used. |
6928 | If the key being used to sign with is a DSA key then | 7258 | If the key being used to sign with is a DSA key, then |
6929 | this option has no effect: SHA1 is always used with DSA keys. | 7259 | this option has no effect: SHA1 is always used with DSA keys. |
6930 | .It Fl engine Ar id | 7260 | .It Fl engine Ar id |
6931 | Specifying an engine (by it's unique | 7261 | Specifying an engine (by it's unique |
6932 | .Ar id | 7262 | .Ar id |
6933 | string) will cause | 7263 | string) will cause |
6934 | .Nm req | 7264 | .Nm x509 |
6935 | to attempt to obtain a functional reference to the specified engine, | 7265 | to attempt to obtain a functional reference to the specified engine, |
6936 | thus initialising it if needed. | 7266 | thus initialising it if needed. |
6937 | The engine will then be set as the default for all available algorithms. | 7267 | The engine will then be set as the default for all available algorithms. |
@@ -6959,19 +7289,25 @@ The | |||
6959 | argument can be a single option or multiple options separated by commas. | 7289 | argument can be a single option or multiple options separated by commas. |
6960 | The | 7290 | The |
6961 | .Fl certopt | 7291 | .Fl certopt |
6962 | switch may be also be used more than once to set multiple options. | 7292 | switch may also be used more than once to set multiple options. |
6963 | See the | 7293 | See the |
6964 | .Sx X509 TEXT OPTIONS | 7294 | .Sx X509 TEXT OPTIONS |
6965 | section for more information. | 7295 | section for more information. |
6966 | .It Fl noout | 7296 | .It Fl noout |
6967 | This option prevents output of the encoded version of the request. | 7297 | This option prevents output of the encoded version of the request. |
7298 | .It Fl ocspid | ||
7299 | Print OCSP hash values for the subject name and public key. | ||
6968 | .It Fl modulus | 7300 | .It Fl modulus |
6969 | This option prints out the value of the modulus of the public key | 7301 | This option prints out the value of the modulus of the public key |
6970 | contained in the certificate. | 7302 | contained in the certificate. |
7303 | .It Fl pubkey | ||
7304 | Ouput the public key. | ||
6971 | .It Fl serial | 7305 | .It Fl serial |
6972 | Outputs the certificate serial number. | 7306 | Outputs the certificate serial number. |
6973 | .It Fl hash | 7307 | .It Fl hash |
6974 | Outputs the "hash" of the certificate subject name. | 7308 | Outputs the |
7309 | .Qq hash | ||
7310 | of the certificate subject name. | ||
6975 | This is used in | 7311 | This is used in |
6976 | .Nm OpenSSL | 7312 | .Nm OpenSSL |
6977 | to form an index to allow certificates in a directory to be looked up | 7313 | to form an index to allow certificates in a directory to be looked up |
@@ -7017,11 +7353,13 @@ A | |||
7017 | .Em trusted certificate | 7353 | .Em trusted certificate |
7018 | is an ordinary certificate which has several | 7354 | is an ordinary certificate which has several |
7019 | additional pieces of information attached to it such as the permitted | 7355 | additional pieces of information attached to it such as the permitted |
7020 | and prohibited uses of the certificate and an "alias". | 7356 | and prohibited uses of the certificate and an |
7357 | .Qq alias . | ||
7021 | .Pp | 7358 | .Pp |
7022 | Normally when a certificate is being verified at least one certificate | 7359 | Normally, when a certificate is being verified at least one certificate |
7023 | must be "trusted". | 7360 | must be |
7024 | By default a trusted certificate must be stored | 7361 | .Qq trusted . |
7362 | By default, a trusted certificate must be stored | ||
7025 | locally and must be a root CA: any certificate chain ending in this CA | 7363 | locally and must be a root CA: any certificate chain ending in this CA |
7026 | is then usable for any purpose. | 7364 | is then usable for any purpose. |
7027 | .Pp | 7365 | .Pp |
@@ -7053,7 +7391,8 @@ are modified. | |||
7053 | .It Fl setalias Ar arg | 7391 | .It Fl setalias Ar arg |
7054 | Sets the alias of the certificate. | 7392 | Sets the alias of the certificate. |
7055 | This will allow the certificate to be referred to using a nickname, | 7393 | This will allow the certificate to be referred to using a nickname, |
7056 | for example "Steve's Certificate". | 7394 | for example |
7395 | .Qq Steve's Certificate . | ||
7057 | .It Fl alias | 7396 | .It Fl alias |
7058 | Outputs the certificate alias, if any. | 7397 | Outputs the certificate alias, if any. |
7059 | .It Fl clrtrust | 7398 | .It Fl clrtrust |
@@ -7064,18 +7403,12 @@ Clears all the prohibited or rejected uses of the certificate. | |||
7064 | Adds a trusted certificate use. | 7403 | Adds a trusted certificate use. |
7065 | Any object name can be used here, but currently only | 7404 | Any object name can be used here, but currently only |
7066 | .Ar clientAuth | 7405 | .Ar clientAuth |
7067 | .Po Em SSL | 7406 | .Pq SSL client use , |
7068 | client use | ||
7069 | .Pc , | ||
7070 | .Ar serverAuth | 7407 | .Ar serverAuth |
7071 | .Po Em SSL | 7408 | .Pq SSL server use , |
7072 | server use | ||
7073 | .Pc | ||
7074 | and | 7409 | and |
7075 | .Ar emailProtection | 7410 | .Ar emailProtection |
7076 | .Po Em S/MIME | 7411 | .Pq S/MIME email |
7077 | |||
7078 | .Pc | ||
7079 | are used. | 7412 | are used. |
7080 | Other | 7413 | Other |
7081 | .Nm OpenSSL | 7414 | .Nm OpenSSL |
@@ -7088,7 +7421,7 @@ option. | |||
7088 | .It Fl purpose | 7421 | .It Fl purpose |
7089 | This option performs tests on the certificate extensions and outputs | 7422 | This option performs tests on the certificate extensions and outputs |
7090 | the results. | 7423 | the results. |
7091 | For a more complete description see the | 7424 | For a more complete description, see the |
7092 | .Sx X509 CERTIFICATE EXTENSIONS | 7425 | .Sx X509 CERTIFICATE EXTENSIONS |
7093 | section. | 7426 | section. |
7094 | .El | 7427 | .El |
@@ -7096,15 +7429,18 @@ section. | |||
7096 | The | 7429 | The |
7097 | .Nm x509 | 7430 | .Nm x509 |
7098 | utility can be used to sign certificates and requests: it | 7431 | utility can be used to sign certificates and requests: it |
7099 | can thus behave like a "mini CA". | 7432 | can thus behave like a |
7433 | .Qq mini CA . | ||
7100 | .Bl -tag -width "XXXX" | 7434 | .Bl -tag -width "XXXX" |
7101 | .It Fl signkey Ar filename | 7435 | .It Fl signkey Ar filename |
7102 | This option causes the input file to be self-signed using the supplied | 7436 | This option causes the input file to be self-signed using the supplied |
7103 | private key. | 7437 | private key. |
7104 | .Pp | 7438 | .Pp |
7105 | If the input file is a certificate, it sets the issuer name to the | 7439 | If the input file is a certificate, it sets the issuer name to the |
7106 | subject name (i.e. makes it self-signed), changes the public key to the | 7440 | subject name |
7107 | supplied value and changes the start and end dates. | 7441 | .Pq i.e. makes it self-signed , |
7442 | changes the public key to the supplied value | ||
7443 | and changes the start and end dates. | ||
7108 | The start date is set to the current time and the end date is set to | 7444 | The start date is set to the current time and the end date is set to |
7109 | a value determined by the | 7445 | a value determined by the |
7110 | .Fl days | 7446 | .Fl days |
@@ -7124,26 +7460,29 @@ certificate (for example with the | |||
7124 | or the | 7460 | or the |
7125 | .Fl CA | 7461 | .Fl CA |
7126 | options). | 7462 | options). |
7127 | Normally all extensions are retained. | 7463 | Normally, all extensions are retained. |
7128 | .It Fl keyform Ar PEM|DER | 7464 | .It Fl keyform Ar DER | PEM |
7129 | Specifies the format | 7465 | Specifies the format |
7130 | .Po Em DER | 7466 | .Pq DER or PEM |
7131 | or | ||
7132 | .Em PEM | ||
7133 | .Pc | ||
7134 | of the private key file used in the | 7467 | of the private key file used in the |
7135 | .Fl signkey | 7468 | .Fl signkey |
7136 | option. | 7469 | option. |
7137 | .It Fl days Ar arg | 7470 | .It Fl days Ar arg |
7138 | Specifies the number of days to make a certificate valid for. | 7471 | Specifies the number of days to make a certificate valid for. |
7139 | The default is 30 days. | 7472 | The default is 30 days. |
7473 | .It Fl checkend Ar arg | ||
7474 | Check whether the certificate expires in the next | ||
7475 | .Ar arg | ||
7476 | seconds. | ||
7477 | If so, exit with return value 1; | ||
7478 | otherwise exit with return value 0. | ||
7140 | .It Fl x509toreq | 7479 | .It Fl x509toreq |
7141 | Converts a certificate into a certificate request. | 7480 | Converts a certificate into a certificate request. |
7142 | The | 7481 | The |
7143 | .Fl signkey | 7482 | .Fl signkey |
7144 | option is used to pass the required private key. | 7483 | option is used to pass the required private key. |
7145 | .It Fl req | 7484 | .It Fl req |
7146 | By default a certificate is expected on input. | 7485 | By default, a certificate is expected on input. |
7147 | With this option a certificate request is expected instead. | 7486 | With this option a certificate request is expected instead. |
7148 | .It Fl set_serial Ar n | 7487 | .It Fl set_serial Ar n |
7149 | Specifies the serial number to use. | 7488 | Specifies the serial number to use. |
@@ -7161,16 +7500,17 @@ or | |||
7161 | options) is not used. | 7500 | options) is not used. |
7162 | .Pp | 7501 | .Pp |
7163 | The serial number can be decimal or hex (if preceded by | 7502 | The serial number can be decimal or hex (if preceded by |
7164 | .Em 0x ) . | 7503 | .Sq 0x ) . |
7165 | Negative serial numbers can also be specified but their use is not recommended. | 7504 | Negative serial numbers can also be specified but their use is not recommended. |
7166 | .It Fl CA Ar filename | 7505 | .It Fl CA Ar filename |
7167 | Specifies the CA certificate to be used for signing. | 7506 | Specifies the CA certificate to be used for signing. |
7168 | When this option is present | 7507 | When this option is present, |
7169 | .Nm x509 | 7508 | .Nm x509 |
7170 | behaves like a "mini CA". | 7509 | behaves like a |
7510 | .Qq mini CA . | ||
7171 | The input file is signed by the CA using this option; | 7511 | The input file is signed by the CA using this option; |
7172 | that is, its issuer name is set to the subject name of the CA and it is | 7512 | that is, its issuer name is set to the subject name of the CA and it is |
7173 | digitally signed using the CAs private key. | 7513 | digitally signed using the CA's private key. |
7174 | .Pp | 7514 | .Pp |
7175 | This option is normally combined with the | 7515 | This option is normally combined with the |
7176 | .Fl req | 7516 | .Fl req |
@@ -7180,7 +7520,7 @@ Without the | |||
7180 | option, the input is a certificate which must be self-signed. | 7520 | option, the input is a certificate which must be self-signed. |
7181 | .It Fl CAkey Ar filename | 7521 | .It Fl CAkey Ar filename |
7182 | Sets the CA private key to sign a certificate with. | 7522 | Sets the CA private key to sign a certificate with. |
7183 | If this option is not specified then it is assumed that the CA private key | 7523 | If this option is not specified, then it is assumed that the CA private key |
7184 | is present in the CA certificate file. | 7524 | is present in the CA certificate file. |
7185 | .It Fl CAserial Ar filename | 7525 | .It Fl CAserial Ar filename |
7186 | Sets the CA serial number file to use. | 7526 | Sets the CA serial number file to use. |
@@ -7197,25 +7537,31 @@ to the file again. | |||
7197 | The default filename consists of the CA certificate file base name with | 7537 | The default filename consists of the CA certificate file base name with |
7198 | .Pa .srl | 7538 | .Pa .srl |
7199 | appended. | 7539 | appended. |
7200 | For example if the CA certificate file is called | 7540 | For example, if the CA certificate file is called |
7201 | .Pa mycacert.pem , | 7541 | .Pa mycacert.pem , |
7202 | it expects to find a serial number file called | 7542 | it expects to find a serial number file called |
7203 | .Pa mycacert.srl . | 7543 | .Pa mycacert.srl . |
7204 | .It Fl CAcreateserial | 7544 | .It Fl CAcreateserial |
7205 | With this option the CA serial number file is created if it does not exist: | 7545 | With this option the CA serial number file is created if it does not exist: |
7206 | it will contain the serial number "02" and the certificate being signed will | 7546 | it will contain the serial number |
7207 | have 1 as its serial number. | 7547 | .Sq 02 |
7208 | Normally if the | 7548 | and the certificate being signed will have |
7549 | .Sq 1 | ||
7550 | as its serial number. | ||
7551 | Normally, if the | ||
7209 | .Fl CA | 7552 | .Fl CA |
7210 | option is specified and the serial number file does not exist it is an error. | 7553 | option is specified and the serial number file does not exist, it is an error. |
7211 | .It Fl extfile Ar filename | 7554 | .It Fl extfile Ar filename |
7212 | File containing certificate extensions to use. | 7555 | File containing certificate extensions to use. |
7213 | If not specified, then no extensions are added to the certificate. | 7556 | If not specified, then no extensions are added to the certificate. |
7214 | .It Fl extensions Ar section | 7557 | .It Fl extensions Ar section |
7215 | The section to add certificate extensions from. | 7558 | The section to add certificate extensions from. |
7216 | If this option is not specified then the extensions should either be | 7559 | If this option is not specified, then the extensions should either be |
7217 | contained in the unnamed (default) section or the default section should | 7560 | contained in the unnamed |
7218 | contain a variable called "extensions" which contains the section to use. | 7561 | .Pq default |
7562 | section or the default section should contain a variable called | ||
7563 | .Qq extensions | ||
7564 | which contains the section to use. | ||
7219 | .El | 7565 | .El |
7220 | .Sh X509 NAME OPTIONS | 7566 | .Sh X509 NAME OPTIONS |
7221 | The | 7567 | The |
@@ -7224,12 +7570,12 @@ command line switch determines how the subject and issuer | |||
7224 | names are displayed. | 7570 | names are displayed. |
7225 | If no | 7571 | If no |
7226 | .Fl nameopt | 7572 | .Fl nameopt |
7227 | switch is present, the default "oneline" | 7573 | switch is present, the default |
7574 | .Qq oneline | ||
7228 | format is used which is compatible with previous versions of | 7575 | format is used which is compatible with previous versions of |
7229 | .Nm OpenSSL . | 7576 | .Nm OpenSSL . |
7230 | Each option is described in detail below, all options can be preceded by | 7577 | Each option is described in detail below; all options can be preceded by a |
7231 | a | 7578 | .Sq - |
7232 | .Cm \&- | ||
7233 | to turn the option off. | 7579 | to turn the option off. |
7234 | Only the first four will normally be used. | 7580 | Only the first four will normally be used. |
7235 | .Bl -tag -width "XXXX" | 7581 | .Bl -tag -width "XXXX" |
@@ -7258,37 +7604,44 @@ It is equivalent to | |||
7258 | and | 7604 | and |
7259 | .Ar align . | 7605 | .Ar align . |
7260 | .It Ar esc_2253 | 7606 | .It Ar esc_2253 |
7261 | Escape the "special" characters required by RFC 2253 in a field that is | 7607 | Escape the |
7262 | .Cm \& ,+"<>; . | 7608 | .Qq special |
7609 | characters required by RFC 2253 in a field that is | ||
7610 | .Dq \& ,+"<>; . | ||
7263 | Additionally, | 7611 | Additionally, |
7264 | .Cm \&# | 7612 | .Sq # |
7265 | is escaped at the beginning of a string | 7613 | is escaped at the beginning of a string |
7266 | and a space character at the beginning or end of a string. | 7614 | and a space character at the beginning or end of a string. |
7267 | .It Ar esc_ctrl | 7615 | .It Ar esc_ctrl |
7268 | Escape control characters. | 7616 | Escape control characters. |
7269 | That is, those with ASCII values less than | 7617 | That is, those with ASCII values less than 0x20 |
7270 | 0x20 (space) and the delete (0x7f) character. | 7618 | .Pq space |
7271 | They are escaped using the RFC2253 \eXX notation (where XX are two hex | 7619 | and the delete |
7620 | .Pq 0x7f | ||
7621 | character. | ||
7622 | They are escaped using the RFC 2253 \eXX notation (where XX are two hex | ||
7272 | digits representing the character value). | 7623 | digits representing the character value). |
7273 | .It Ar esc_msb | 7624 | .It Ar esc_msb |
7274 | Escape characters with the MSB set; that is, with ASCII values larger than | 7625 | Escape characters with the MSB set; that is, with ASCII values larger than |
7275 | 127. | 7626 | 127. |
7276 | .It Ar use_quote | 7627 | .It Ar use_quote |
7277 | Escapes some characters by surrounding the whole string with | 7628 | Escapes some characters by surrounding the whole string with |
7278 | .Cm \&" | 7629 | .Sq \&" |
7279 | characters. | 7630 | characters. |
7280 | Without the option, all escaping is done with the | 7631 | Without the option, all escaping is done with the |
7281 | .Cm \&\e | 7632 | .Sq \e |
7282 | character. | 7633 | character. |
7283 | .It Ar utf8 | 7634 | .It Ar utf8 |
7284 | Convert all strings to UTF8 format first. | 7635 | Convert all strings to UTF8 format first. |
7285 | This is required by RFC 2253. | 7636 | This is required by RFC 2253. |
7286 | If you are lucky enough to have a UTF8 compatible terminal then the use | 7637 | If you are lucky enough to have a UTF8 compatible terminal, then the use |
7287 | of this option (and | 7638 | of this option (and |
7288 | .Em not | 7639 | .Em not |
7289 | setting | 7640 | setting |
7290 | .Ar esc_msb ) | 7641 | .Ar esc_msb ) |
7291 | may result in the correct display of multibyte (international) characters. | 7642 | may result in the correct display of multibyte |
7643 | .Pq international | ||
7644 | characters. | ||
7292 | If this option is not present, then multibyte characters larger than 0xff | 7645 | If this option is not present, then multibyte characters larger than 0xff |
7293 | will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX | 7646 | will be represented using the format \eUXXXX for 16 bits and \eWXXXXXXXX |
7294 | for 32 bits. | 7647 | for 32 bits. |
@@ -7304,15 +7657,17 @@ looking output. | |||
7304 | .It Ar show_type | 7657 | .It Ar show_type |
7305 | Show the type of the ASN1 character string. | 7658 | Show the type of the ASN1 character string. |
7306 | The type precedes the field contents. | 7659 | The type precedes the field contents. |
7307 | For example "BMPSTRING: Hello World". | 7660 | For example |
7661 | .Qq BMPSTRING: Hello World . | ||
7308 | .It Ar dump_der | 7662 | .It Ar dump_der |
7309 | When this option is set, any fields that need to be hexdumped will | 7663 | When this option is set, any fields that need to be hexdumped will |
7310 | be dumped using the DER encoding of the field. | 7664 | be dumped using the DER encoding of the field. |
7311 | Otherwise just the content octets will be displayed. | 7665 | Otherwise just the content octets will be displayed. |
7312 | Both options use the RFC2253 #XXXX... format. | 7666 | Both options use the RFC 2253 #XXXX... format. |
7313 | .It Ar dump_nostr | 7667 | .It Ar dump_nostr |
7314 | Dump non-character string types (for example OCTET STRING); if this | 7668 | Dump non-character string types |
7315 | option is not set then non-character string types will be displayed | 7669 | .Pq for example OCTET STRING ; |
7670 | if this option is not set, then non-character string types will be displayed | ||
7316 | as though each content octet represents a single character. | 7671 | as though each content octet represents a single character. |
7317 | .It Ar dump_all | 7672 | .It Ar dump_all |
7318 | Dump all fields. | 7673 | Dump all fields. |
@@ -7326,12 +7681,13 @@ Dump any field whose OID is not recognised by | |||
7326 | These options determine the field separators. | 7681 | These options determine the field separators. |
7327 | The first character is between RDNs and the second between multiple AVAs | 7682 | The first character is between RDNs and the second between multiple AVAs |
7328 | (multiple AVAs are very rare and their use is discouraged). | 7683 | (multiple AVAs are very rare and their use is discouraged). |
7329 | The options ending in "space" additionally place a space after the | 7684 | The options ending in |
7330 | separator to make it more readable. | 7685 | .Qq space |
7686 | additionally place a space after the separator to make it more readable. | ||
7331 | The | 7687 | The |
7332 | .Ar sep_multiline | 7688 | .Ar sep_multiline |
7333 | uses a linefeed character for the RDN separator and a spaced | 7689 | uses a linefeed character for the RDN separator and a spaced |
7334 | .Cm \&+ | 7690 | .Sq + |
7335 | for the AVA separator. | 7691 | for the AVA separator. |
7336 | It also indents the fields by four characters. | 7692 | It also indents the fields by four characters. |
7337 | .It Ar dn_rev | 7693 | .It Ar dn_rev |
@@ -7344,7 +7700,9 @@ These options alter how the field name is displayed. | |||
7344 | .Ar nofname | 7700 | .Ar nofname |
7345 | does not display the field at all. | 7701 | does not display the field at all. |
7346 | .Ar sname | 7702 | .Ar sname |
7347 | uses the "short name" form (CN for | 7703 | uses the |
7704 | .Qq short name | ||
7705 | form (CN for | ||
7348 | .Ar commonName , | 7706 | .Ar commonName , |
7349 | for example). | 7707 | for example). |
7350 | .Ar lname | 7708 | .Ar lname |
@@ -7357,7 +7715,7 @@ Only usable with | |||
7357 | .Ar sep_multiline . | 7715 | .Ar sep_multiline . |
7358 | .It Ar spc_eq | 7716 | .It Ar spc_eq |
7359 | Places spaces round the | 7717 | Places spaces round the |
7360 | .Cm \&= | 7718 | .Sq = |
7361 | character which follows the field name. | 7719 | character which follows the field name. |
7362 | .El | 7720 | .El |
7363 | .Sh X509 TEXT OPTIONS | 7721 | .Sh X509 TEXT OPTIONS |
@@ -7373,8 +7731,10 @@ The default behaviour is to print all fields. | |||
7373 | Use the old format. | 7731 | Use the old format. |
7374 | This is equivalent to specifying no output options at all. | 7732 | This is equivalent to specifying no output options at all. |
7375 | .It Ar no_header | 7733 | .It Ar no_header |
7376 | Don't print header information: that is, the lines saying "Certificate" | 7734 | Don't print header information: that is, the lines saying |
7377 | and "Data". | 7735 | .Qq Certificate |
7736 | and | ||
7737 | .Qq Data . | ||
7378 | .It Ar no_version | 7738 | .It Ar no_version |
7379 | Don't print out the version number. | 7739 | Don't print out the version number. |
7380 | .It Ar no_serial | 7740 | .It Ar no_serial |
@@ -7419,37 +7779,40 @@ and | |||
7419 | .El | 7779 | .El |
7420 | .Sh X509 EXAMPLES | 7780 | .Sh X509 EXAMPLES |
7421 | .Sy Note : | 7781 | .Sy Note : |
7422 | In these examples the '\e' means the example should be all on one | 7782 | In these examples the |
7423 | line. | 7783 | .Sq \e |
7784 | means the example should be all on one line. | ||
7424 | .Pp | 7785 | .Pp |
7425 | Display the contents of a certificate: | 7786 | Display the contents of a certificate: |
7426 | .Pp | 7787 | .Pp |
7427 | \& $ openssl x509 -in cert.pem -noout -text | 7788 | .Dl $ openssl x509 -in cert.pem -noout -text |
7428 | .Pp | 7789 | .Pp |
7429 | Display the certificate serial number: | 7790 | Display the certificate serial number: |
7430 | .Pp | 7791 | .Pp |
7431 | \& $ openssl x509 -in cert.pem -noout -serial | 7792 | .Dl $ openssl x509 -in cert.pem -noout -serial |
7432 | .Pp | 7793 | .Pp |
7433 | Display the certificate subject name: | 7794 | Display the certificate subject name: |
7434 | .Pp | 7795 | .Pp |
7435 | \& $ openssl x509 -in cert.pem -noout -subject | 7796 | .Dl $ openssl x509 -in cert.pem -noout -subject |
7436 | .Pp | 7797 | .Pp |
7437 | Display the certificate subject name in RFC2253 form: | 7798 | Display the certificate subject name in RFC 2253 form: |
7438 | .Pp | 7799 | .Pp |
7439 | \& $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253 | 7800 | .Dl $ openssl x509 -in cert.pem -noout -subject -nameopt RFC2253 |
7440 | .Pp | 7801 | .Pp |
7441 | Display the certificate subject name in oneline form on a terminal | 7802 | Display the certificate subject name in oneline form on a terminal |
7442 | supporting UTF8: | 7803 | supporting UTF8: |
7443 | .Pp | 7804 | .Bd -literal -offset indent |
7444 | \& $ openssl x509 -in cert.pem -noout -subject -nameopt oneline,-escmsb | 7805 | $ openssl x509 -in cert.pem -noout -subject \e |
7806 | -nameopt oneline,-escmsb | ||
7807 | .Ed | ||
7445 | .Pp | 7808 | .Pp |
7446 | Display the certificate MD5 fingerprint: | 7809 | Display the certificate MD5 fingerprint: |
7447 | .Pp | 7810 | .Pp |
7448 | \& $ openssl x509 -in cert.pem -noout -fingerprint | 7811 | .Dl $ openssl x509 -in cert.pem -noout -fingerprint |
7449 | .Pp | 7812 | .Pp |
7450 | Display the certificate SHA1 fingerprint: | 7813 | Display the certificate SHA1 fingerprint: |
7451 | .Pp | 7814 | .Pp |
7452 | \& $ openssl x509 -sha1 -in cert.pem -noout -fingerprint | 7815 | .Dl $ openssl x509 -sha1 -in cert.pem -noout -fingerprint |
7453 | .Pp | 7816 | .Pp |
7454 | Convert a certificate from | 7817 | Convert a certificate from |
7455 | .Em PEM | 7818 | .Em PEM |
@@ -7457,51 +7820,54 @@ to | |||
7457 | .Em DER | 7820 | .Em DER |
7458 | format: | 7821 | format: |
7459 | .Pp | 7822 | .Pp |
7460 | \& $ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER | 7823 | .Dl "$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER" |
7461 | .Pp | 7824 | .Pp |
7462 | Convert a certificate to a certificate request: | 7825 | Convert a certificate to a certificate request: |
7463 | .Pp | 7826 | .Bd -literal -offset indent |
7464 | \& $ openssl x509 -x509toreq -in cert.pem -out req.pem -signkey key.pem | 7827 | $ openssl x509 -x509toreq -in cert.pem -out req.pem \e |
7828 | -signkey key.pem | ||
7829 | .Ed | ||
7465 | .Pp | 7830 | .Pp |
7466 | Convert a certificate request into a self-signed certificate using | 7831 | Convert a certificate request into a self-signed certificate using |
7467 | extensions for a CA: | 7832 | extensions for a CA: |
7468 | .Bd -literal | 7833 | .Bd -literal -offset indent |
7469 | \& $ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e | 7834 | $ openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions \e |
7470 | \& v3_ca -signkey key.pem -out cacert.pem | 7835 | v3_ca -signkey key.pem -out cacert.pem |
7471 | .Ed | 7836 | .Ed |
7472 | .Pp | 7837 | .Pp |
7473 | Sign a certificate request using the CA certificate above and add user | 7838 | Sign a certificate request using the CA certificate above and add user |
7474 | certificate extensions: | 7839 | certificate extensions: |
7475 | .Bd -literal | 7840 | .Bd -literal -offset indent |
7476 | \& $ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e | 7841 | $ openssl x509 -req -in req.pem -extfile openssl.cnf -extensions \e |
7477 | v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial | 7842 | v3_usr -CA cacert.pem -CAkey key.pem -CAcreateserial |
7478 | .Ed | 7843 | .Ed |
7479 | .Pp | 7844 | .Pp |
7480 | Set a certificate to be trusted for SSL | 7845 | Set a certificate to be trusted for SSL |
7481 | client use and set its alias to "Steve's Class 1 CA": | 7846 | client use and set its alias to |
7482 | .Bd -literal | 7847 | .Qq Steve's Class 1 CA : |
7483 | \& $ openssl x509 -in cert.pem -addtrust clientAuth \e | 7848 | .Bd -literal -offset indent |
7484 | \& -setalias "Steve's Class 1 CA" -out trust.pem | 7849 | $ openssl x509 -in cert.pem -addtrust clientAuth \e |
7850 | -setalias "Steve's Class 1 CA" -out trust.pem | ||
7485 | .Ed | 7851 | .Ed |
7486 | .Sh X509 NOTES | 7852 | .Sh X509 NOTES |
7487 | The | 7853 | The |
7488 | .Em PEM | 7854 | .Em PEM |
7489 | format uses the header and footer lines: | 7855 | format uses the header and footer lines: |
7490 | .Bd -literal | 7856 | .Bd -unfilled -offset indent |
7491 | \& -----BEGIN CERTIFICATE----- | 7857 | -----BEGIN CERTIFICATE----- |
7492 | \& -----END CERTIFICATE----- | 7858 | -----END CERTIFICATE----- |
7493 | .Ed | 7859 | .Ed |
7494 | .Pp | 7860 | .Pp |
7495 | It will also handle files containing: | 7861 | It will also handle files containing: |
7496 | .Bd -literal | 7862 | .Bd -unfilled -offset indent |
7497 | \& -----BEGIN X509 CERTIFICATE----- | 7863 | -----BEGIN X509 CERTIFICATE----- |
7498 | \& -----END X509 CERTIFICATE----- | 7864 | -----END X509 CERTIFICATE----- |
7499 | .Ed | 7865 | .Ed |
7500 | .Pp | 7866 | .Pp |
7501 | Trusted certificates have the lines: | 7867 | Trusted certificates have the lines: |
7502 | .Bd -literal | 7868 | .Bd -unfilled -offset indent |
7503 | \& -----BEGIN TRUSTED CERTIFICATE----- | 7869 | -----BEGIN TRUSTED CERTIFICATE----- |
7504 | \& -----END TRUSTED CERTIFICATE----- | 7870 | -----END TRUSTED CERTIFICATE----- |
7505 | .Ed | 7871 | .Ed |
7506 | .Pp | 7872 | .Pp |
7507 | The conversion to UTF8 format used with the name options assumes that | 7873 | The conversion to UTF8 format used with the name options assumes that |
@@ -7513,7 +7879,8 @@ it is more likely to display the majority of certificates correctly. | |||
7513 | The | 7879 | The |
7514 | .Fl fingerprint | 7880 | .Fl fingerprint |
7515 | option takes the digest of the DER encoded certificate. | 7881 | option takes the digest of the DER encoded certificate. |
7516 | This is commonly called a "fingerprint". | 7882 | This is commonly called a |
7883 | .Qq fingerprint . | ||
7517 | Because of the nature of message digests, the fingerprint of a certificate | 7884 | Because of the nature of message digests, the fingerprint of a certificate |
7518 | is unique to that certificate and two certificates with the same fingerprint | 7885 | is unique to that certificate and two certificates with the same fingerprint |
7519 | can be considered to be the same. | 7886 | can be considered to be the same. |
@@ -7542,22 +7909,24 @@ The | |||
7542 | .Em basicConstraints | 7909 | .Em basicConstraints |
7543 | extension CA flag is used to determine whether the | 7910 | extension CA flag is used to determine whether the |
7544 | certificate can be used as a CA. | 7911 | certificate can be used as a CA. |
7545 | If the CA flag is true then it is a CA, | 7912 | If the CA flag is true, then it is a CA; |
7546 | if the CA flag is false then it is not a CA. | 7913 | if the CA flag is false, then it is not a CA. |
7547 | .Em All | 7914 | .Em All |
7548 | CAs should have the CA flag set to true. | 7915 | CAs should have the CA flag set to true. |
7549 | .Pp | 7916 | .Pp |
7550 | If the | 7917 | If the |
7551 | .Em basicConstraints | 7918 | .Em basicConstraints |
7552 | extension is absent then the certificate is | 7919 | extension is absent, then the certificate is |
7553 | considered to be a "possible CA"; other extensions are checked according | 7920 | considered to be a |
7554 | to the intended use of the certificate. | 7921 | .Qq possible CA ; |
7922 | other extensions are checked according to the intended use of the certificate. | ||
7555 | A warning is given in this case because the certificate should really not | 7923 | A warning is given in this case because the certificate should really not |
7556 | be regarded as a CA: however, | 7924 | be regarded as a CA: however, |
7557 | it is allowed to be a CA to work around some broken software. | 7925 | it is allowed to be a CA to work around some broken software. |
7558 | .Pp | 7926 | .Pp |
7559 | If the certificate is a V1 certificate (and thus has no extensions) and | 7927 | If the certificate is a V1 certificate |
7560 | it is self-signed, it is also assumed to be a CA but a warning is again | 7928 | .Pq and thus has no extensions |
7929 | and it is self-signed, it is also assumed to be a CA but a warning is again | ||
7561 | given: this is to work around the problem of Verisign roots which are V1 | 7930 | given: this is to work around the problem of Verisign roots which are V1 |
7562 | self-signed certificates. | 7931 | self-signed certificates. |
7563 | .Pp | 7932 | .Pp |
@@ -7575,7 +7944,8 @@ extension is present. | |||
7575 | .Pp | 7944 | .Pp |
7576 | The extended key usage extension places additional restrictions on the | 7945 | The extended key usage extension places additional restrictions on the |
7577 | certificate uses. | 7946 | certificate uses. |
7578 | If this extension is present (whether critical or not) | 7947 | If this extension is present |
7948 | .Pq whether critical or not , | ||
7579 | the key can only be used for the purposes specified. | 7949 | the key can only be used for the purposes specified. |
7580 | .Pp | 7950 | .Pp |
7581 | A complete description of each test is given below. | 7951 | A complete description of each test is given below. |
@@ -7589,7 +7959,8 @@ CA certificates. | |||
7589 | .Bl -tag -width "XXXX" | 7959 | .Bl -tag -width "XXXX" |
7590 | .It Ar SSL Client | 7960 | .It Ar SSL Client |
7591 | The extended key usage extension must be absent or include the | 7961 | The extended key usage extension must be absent or include the |
7592 | "web client authentication" OID. | 7962 | .Qq web client authentication |
7963 | OID. | ||
7593 | .Ar keyUsage | 7964 | .Ar keyUsage |
7594 | must be absent or it must have the | 7965 | must be absent or it must have the |
7595 | .Em digitalSignature | 7966 | .Em digitalSignature |
@@ -7598,14 +7969,16 @@ Netscape certificate type must be absent or it must have the SSL | |||
7598 | client bit set. | 7969 | client bit set. |
7599 | .It Ar SSL Client CA | 7970 | .It Ar SSL Client CA |
7600 | The extended key usage extension must be absent or include the | 7971 | The extended key usage extension must be absent or include the |
7601 | "web client authentication" OID. | 7972 | .Qq web client authentication |
7973 | OID. | ||
7602 | Netscape certificate type must be absent or it must have the SSL CA | 7974 | Netscape certificate type must be absent or it must have the SSL CA |
7603 | bit set: this is used as a work around if the | 7975 | bit set: this is used as a work around if the |
7604 | .Em basicConstraints | 7976 | .Em basicConstraints |
7605 | extension is absent. | 7977 | extension is absent. |
7606 | .It Ar SSL Server | 7978 | .It Ar SSL Server |
7607 | The extended key usage extension must be absent or include the | 7979 | The extended key usage extension must be absent or include the |
7608 | "web server authentication" and/or one of the SGC OIDs. | 7980 | .Qq web server authentication |
7981 | and/or one of the SGC OIDs. | ||
7609 | .Em keyUsage | 7982 | .Em keyUsage |
7610 | must be absent or it must have the | 7983 | must be absent or it must have the |
7611 | .Em digitalSignature | 7984 | .Em digitalSignature |
@@ -7615,7 +7988,8 @@ set, or both bits set. | |||
7615 | Netscape certificate type must be absent or have the SSL server bit set. | 7988 | Netscape certificate type must be absent or have the SSL server bit set. |
7616 | .It Ar SSL Server CA | 7989 | .It Ar SSL Server CA |
7617 | The extended key usage extension must be absent or include the | 7990 | The extended key usage extension must be absent or include the |
7618 | "web server authentication" and/or one of the SGC OIDs. | 7991 | .Qq web server authentication |
7992 | and/or one of the SGC OIDs. | ||
7619 | Netscape certificate type must be absent or the SSL CA | 7993 | Netscape certificate type must be absent or the SSL CA |
7620 | bit must be set: this is used as a work around if the | 7994 | bit must be set: this is used as a work around if the |
7621 | .Em basicConstraints | 7995 | .Em basicConstraints |
@@ -7631,13 +8005,14 @@ digital signing. | |||
7631 | Otherwise it is the same as a normal SSL server. | 8005 | Otherwise it is the same as a normal SSL server. |
7632 | .It Ar Common S/MIME Client Tests | 8006 | .It Ar Common S/MIME Client Tests |
7633 | The extended key usage extension must be absent or include the | 8007 | The extended key usage extension must be absent or include the |
7634 | "email protection" OID. | 8008 | .Qq email protection |
8009 | OID. | ||
7635 | Netscape certificate type must be absent or should have the | 8010 | Netscape certificate type must be absent or should have the |
7636 | .Em S/MIME | 8011 | .Em S/MIME |
7637 | bit set. | 8012 | bit set. |
7638 | If the | 8013 | If the |
7639 | .Em S/MIME | 8014 | .Em S/MIME |
7640 | bit is not set in netscape certificate type, then the SSL | 8015 | bit is not set in Netscape certificate type, then the SSL |
7641 | client bit is tolerated as an alternative but a warning is shown: | 8016 | client bit is tolerated as an alternative but a warning is shown: |
7642 | this is because some Verisign certificates don't set the | 8017 | this is because some Verisign certificates don't set the |
7643 | .Em S/MIME | 8018 | .Em S/MIME |
@@ -7660,7 +8035,8 @@ bit must be set if the | |||
7660 | extension is present. | 8035 | extension is present. |
7661 | .It Ar S/MIME CA | 8036 | .It Ar S/MIME CA |
7662 | The extended key usage extension must be absent or include the | 8037 | The extended key usage extension must be absent or include the |
7663 | "email protection" OID. | 8038 | .Qq email protection |
8039 | OID. | ||
7664 | Netscape certificate type must be absent or must have the | 8040 | Netscape certificate type must be absent or must have the |
7665 | .Em S/MIME CA | 8041 | .Em S/MIME CA |
7666 | bit set: this is used as a work around if the | 8042 | bit set: this is used as a work around if the |