diff options
author | jmc <> | 2010-10-09 10:03:44 +0000 |
---|---|---|
committer | jmc <> | 2010-10-09 10:03:44 +0000 |
commit | c11440122a12473ff58c3ec76b88db05c3c6733a (patch) | |
tree | d48d92d43fe631d980e36f232bc6ae15925d8107 /src | |
parent | 0b0e628f61a7b75e8bb9281c592e1a4da79a0586 (diff) | |
download | openbsd-c11440122a12473ff58c3ec76b88db05c3c6733a.tar.gz openbsd-c11440122a12473ff58c3ec76b88db05c3c6733a.tar.bz2 openbsd-c11440122a12473ff58c3ec76b88db05c3c6733a.zip |
document "openssl genpkey";
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.sbin/openssl/openssl.1 | 178 |
1 files changed, 176 insertions, 2 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1 index bc3f26f500..386699c6ff 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.72 2010/10/08 19:18:41 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.73 2010/10/09 10:03:44 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 | .\" |
@@ -112,7 +112,7 @@ | |||
112 | .\" | 112 | .\" |
113 | .\" OPENSSL | 113 | .\" OPENSSL |
114 | .\" | 114 | .\" |
115 | .Dd $Mdocdate: October 8 2010 $ | 115 | .Dd $Mdocdate: October 9 2010 $ |
116 | .Dt OPENSSL 1 | 116 | .Dt OPENSSL 1 |
117 | .Os | 117 | .Os |
118 | .Sh NAME | 118 | .Sh NAME |
@@ -298,6 +298,8 @@ Superseded by | |||
298 | .Cm genpkey | 298 | .Cm genpkey |
299 | and | 299 | and |
300 | .Cm pkey . | 300 | .Cm pkey . |
301 | .It Cm genpkey | ||
302 | Generation of private keys or parameters. | ||
301 | .It Cm genrsa | 303 | .It Cm genrsa |
302 | Generation of RSA private key. | 304 | Generation of RSA private key. |
303 | Superseded by | 305 | Superseded by |
@@ -3410,6 +3412,178 @@ Multiple files can be specified separated by a | |||
3410 | DSA key generation is little more than random number generation so it is | 3412 | DSA key generation is little more than random number generation so it is |
3411 | much quicker than RSA key generation, for example. | 3413 | much quicker than RSA key generation, for example. |
3412 | .\" | 3414 | .\" |
3415 | .\" GENPKEY | ||
3416 | .\" | ||
3417 | .Sh GENPKEY | ||
3418 | .Nm openssl genpkey | ||
3419 | .Bk -words | ||
3420 | .Op Ar cipher | ||
3421 | .Op Fl genparam | ||
3422 | .Op Fl pass Ar arg | ||
3423 | .Op Fl text | ||
3424 | .Op Fl algorithm Ar alg | ||
3425 | .Op Fl engine Ar id | ||
3426 | .Op Fl out Ar filename | ||
3427 | .Op Fl outform Ar DER | PEM | ||
3428 | .Op Fl paramfile Ar file | ||
3429 | .Op Fl pkeyopt Ar opt : Ns Ar value | ||
3430 | .Ek | ||
3431 | .Pp | ||
3432 | The | ||
3433 | .Nm genpkey | ||
3434 | command generates private keys. | ||
3435 | The use of this | ||
3436 | program is encouraged over the algorithm specific utilities | ||
3437 | because additional algorithm options | ||
3438 | and engine-provided algorithms can be used. | ||
3439 | .Pp | ||
3440 | The options are as follows: | ||
3441 | .Bl -tag -width Ds | ||
3442 | .It Fl algorithm Ar alg | ||
3443 | The public key algorithm to use, | ||
3444 | such as RSA, DSA, or DH. | ||
3445 | If used this option must precede any | ||
3446 | .Fl pkeyopt | ||
3447 | options. | ||
3448 | The options | ||
3449 | .Fl paramfile | ||
3450 | and | ||
3451 | .Fl algorithm | ||
3452 | are mutually exclusive. | ||
3453 | .It Ar cipher | ||
3454 | Encrypt the private key with the supplied cipher. | ||
3455 | Any algorithm name accepted by | ||
3456 | .Fn EVP_get_cipherbyname | ||
3457 | is acceptable, such as | ||
3458 | .Cm des3 . | ||
3459 | .It Fl engine Ar id | ||
3460 | Specifying an engine (by its unique | ||
3461 | .Ar id | ||
3462 | string) will cause | ||
3463 | .Nm genpkey | ||
3464 | to attempt to obtain a functional reference to the specified engine, | ||
3465 | thus initialising it if needed. | ||
3466 | The engine will then be set as the default | ||
3467 | for all available algorithms. | ||
3468 | .It Fl genparam | ||
3469 | Generate a set of parameters instead of a private key. | ||
3470 | If used this option must precede any | ||
3471 | .Fl algorithm , | ||
3472 | .Fl paramfile , | ||
3473 | or | ||
3474 | .Fl pkeyopt | ||
3475 | options. | ||
3476 | .It Fl out Ar filename | ||
3477 | The output filename. | ||
3478 | If this argument is not specified then standard output is used. | ||
3479 | .It Fl outform Ar DER | PEM | ||
3480 | This specifies the output format, DER or PEM. | ||
3481 | .It Fl paramfile Ar file | ||
3482 | Some public key algorithms generate a private key based on a set of parameters. | ||
3483 | They can be supplied using this option. | ||
3484 | If this option is used the public key | ||
3485 | algorithm used is determined by the parameters. | ||
3486 | If used this option must precede any | ||
3487 | .Fl pkeyopt | ||
3488 | options. | ||
3489 | The options | ||
3490 | .Fl paramfile | ||
3491 | and | ||
3492 | .Fl algorithm | ||
3493 | are mutually exclusive. | ||
3494 | .It Fl pass Ar arg | ||
3495 | The output file password source. | ||
3496 | For more information about the format of | ||
3497 | .Ar arg | ||
3498 | see the | ||
3499 | .Sx PASS PHRASE ARGUMENTS | ||
3500 | section above. | ||
3501 | .It Fl pkeyopt Ar opt : Ns Ar value | ||
3502 | Set the public key algorithm option | ||
3503 | .Ar opt | ||
3504 | to | ||
3505 | .Ar value . | ||
3506 | The precise set of options supported | ||
3507 | depends on the public key algorithm used and its implementation. | ||
3508 | See | ||
3509 | .Sx GENPKEY KEY GENERATION OPTIONS | ||
3510 | below for more details. | ||
3511 | .It Fl text | ||
3512 | Print an (unencrypted) text representation of private and public keys and | ||
3513 | parameters along with the DER or PEM structure. | ||
3514 | .El | ||
3515 | .Sh GENPKEY KEY GENERATION OPTIONS | ||
3516 | The options supported by each algorithm | ||
3517 | and indeed each implementation of an algorithm can vary. | ||
3518 | The options for the | ||
3519 | .Nm OpenSSL | ||
3520 | implementations are detailed below. | ||
3521 | .Bl -tag -width Ds -offset indent | ||
3522 | .It rsa_keygen_bits : Ns Ar numbits | ||
3523 | (RSA) | ||
3524 | The number of bits in the generated key. | ||
3525 | If not specified 1024 is used. | ||
3526 | .It rsa_keygen_pubexp : Ns Ar value | ||
3527 | (RSA) | ||
3528 | The RSA public exponent value. | ||
3529 | This can be a large decimal or hexadecimal value if preceded by 0x. | ||
3530 | The default value is 65537. | ||
3531 | .It dsa_paramgen_bits : Ns Ar numbits | ||
3532 | (DSA) | ||
3533 | The number of bits in the generated parameters. | ||
3534 | If not specified 1024 is used. | ||
3535 | .It dh_paramgen_prime_len : Ns Ar numbits | ||
3536 | (DH) | ||
3537 | The number of bits in the prime parameter | ||
3538 | .Ar p . | ||
3539 | .It dh_paramgen_generator : Ns Ar value | ||
3540 | (DH) | ||
3541 | The value to use for the generator | ||
3542 | .Ar g . | ||
3543 | .It ec_paramgen_curve : Ns Ar curve | ||
3544 | (EC) | ||
3545 | The EC curve to use. | ||
3546 | .El | ||
3547 | .Sh GENPKEY EXAMPLES | ||
3548 | Generate an RSA private key using default parameters: | ||
3549 | .Bd -literal -offset indent | ||
3550 | $ openssl genpkey -algorithm RSA -out key.pem | ||
3551 | .Ed | ||
3552 | .Pp | ||
3553 | Encrypt and output a private key using 128-bit AES and the passphrase "hello": | ||
3554 | .Bd -literal -offset indent | ||
3555 | $ openssl genpkey -algorithm RSA -out key.pem \e | ||
3556 | -aes-128-cbc -pass pass:hello | ||
3557 | .Ed | ||
3558 | .Pp | ||
3559 | Generate a 2048-bit RSA key using 3 as the public exponent: | ||
3560 | .Bd -literal -offset indent | ||
3561 | $ openssl genpkey -algorithm RSA -out key.pem \e | ||
3562 | -pkeyopt rsa_keygen_bits:2048 -pkeyopt rsa_keygen_pubexp:3 | ||
3563 | .Ed | ||
3564 | .Pp | ||
3565 | Generate 1024-bit DSA parameters: | ||
3566 | .Bd -literal -offset indent | ||
3567 | $ openssl genpkey -genparam -algorithm DSA \e | ||
3568 | -out dsap.pem -pkeyopt dsa_paramgen_bits:1024 | ||
3569 | .Ed | ||
3570 | .Pp | ||
3571 | Generate a DSA key from parameters: | ||
3572 | .Bd -literal -offset indent | ||
3573 | $ openssl genpkey -paramfile dsap.pem -out dsakey.pem | ||
3574 | .Ed | ||
3575 | .Pp | ||
3576 | Generate 1024-bit DH parameters: | ||
3577 | .Bd -literal -offset indent | ||
3578 | $ openssl genpkey -genparam -algorithm DH \e | ||
3579 | -out dhp.pem -pkeyopt dh_paramgen_prime_len:1024 | ||
3580 | .Ed | ||
3581 | .Pp | ||
3582 | Generate a DH key from parameters: | ||
3583 | .Bd -literal -offset indent | ||
3584 | $ openssl genpkey -paramfile dhp.pem -out dhkey.pem | ||
3585 | .Ed | ||
3586 | .\" | ||
3413 | .\" GENRSA | 3587 | .\" GENRSA |
3414 | .\" | 3588 | .\" |
3415 | .Sh GENRSA | 3589 | .Sh GENRSA |