Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 1 | =pod |
| 2 | |
Rich Salz | 9fcb970 | 2019-10-12 17:45:56 -0400 | [diff] [blame^] | 3 | =begin comment |
| 4 | {- join("\n", @autowarntext) -} |
| 5 | |
| 6 | =end comment |
| 7 | |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 8 | =head1 NAME |
| 9 | |
Dr. Matthias St. Pierre | b6b6657 | 2019-08-22 01:04:41 +0200 | [diff] [blame] | 10 | openssl-genrsa - generate an RSA private key |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 11 | |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 12 | =head1 SYNOPSIS |
| 13 | |
| 14 | B<openssl> B<genrsa> |
A J Mohan Rao | 169394d | 2016-02-05 11:58:45 -0500 | [diff] [blame] | 15 | [B<-help>] |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 16 | [B<-out> I<filename>] |
| 17 | [B<-passout> I<arg>] |
Rich Salz | fc1d88f | 2014-07-02 22:42:40 -0400 | [diff] [blame] | 18 | [B<-aes128>] |
Rich Salz | fc1d88f | 2014-07-02 22:42:40 -0400 | [diff] [blame] | 19 | [B<-aes192>] |
| 20 | [B<-aes256>] |
Pauli | d42d0a4 | 2017-02-01 10:10:13 +1000 | [diff] [blame] | 21 | [B<-aria128>] |
| 22 | [B<-aria192>] |
| 23 | [B<-aria256>] |
Rich Salz | fc1d88f | 2014-07-02 22:42:40 -0400 | [diff] [blame] | 24 | [B<-camellia128>] |
| 25 | [B<-camellia192>] |
| 26 | [B<-camellia256>] |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 27 | [B<-des>] |
| 28 | [B<-des3>] |
| 29 | [B<-idea>] |
Richard Levitte | 2f0ea93 | 2019-10-01 18:16:29 +0200 | [diff] [blame] | 30 | [B<-f4>|B<-3>] |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 31 | [B<-engine> I<id>] |
| 32 | [B<-primes> I<num>] |
Philip Prindeville | c43fa56 | 2018-08-08 11:51:23 -0600 | [diff] [blame] | 33 | [B<-verbose>] |
Rich Salz | 9fcb970 | 2019-10-12 17:45:56 -0400 | [diff] [blame^] | 34 | {- $OpenSSL::safe::opt_r_synopsis -} |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 35 | [B<numbits>] |
| 36 | |
Rich Salz | 9f3c076 | 2019-10-11 11:52:12 -0400 | [diff] [blame] | 37 | =for openssl ifdef engine |
Rich Salz | 1738c0c | 2019-09-22 19:49:25 -0400 | [diff] [blame] | 38 | |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 39 | =head1 DESCRIPTION |
| 40 | |
Richard Levitte | 35a810b | 2019-10-01 19:43:36 +0200 | [diff] [blame] | 41 | This command generates an RSA private key. |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 42 | |
| 43 | =head1 OPTIONS |
| 44 | |
| 45 | =over 4 |
| 46 | |
A J Mohan Rao | 169394d | 2016-02-05 11:58:45 -0500 | [diff] [blame] | 47 | =item B<-help> |
| 48 | |
| 49 | Print out a usage message. |
| 50 | |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 51 | =item B<-out> I<filename> |
Dr. Stephen Henson | f07fb9b | 2000-02-08 01:34:59 +0000 | [diff] [blame] | 52 | |
A J Mohan Rao | 169394d | 2016-02-05 11:58:45 -0500 | [diff] [blame] | 53 | Output the key to the specified file. If this argument is not specified then |
| 54 | standard output is used. |
Dr. Stephen Henson | f07fb9b | 2000-02-08 01:34:59 +0000 | [diff] [blame] | 55 | |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 56 | =item B<-passout> I<arg> |
Dr. Stephen Henson | f07fb9b | 2000-02-08 01:34:59 +0000 | [diff] [blame] | 57 | |
Pauli | c4de074 | 2017-03-30 07:38:30 +1000 | [diff] [blame] | 58 | The output file password source. For more information about the format |
Rich Salz | 3a4e43d | 2019-10-08 13:10:04 -0400 | [diff] [blame] | 59 | see L<openssl(1)/Pass Phrase Options>. |
Dr. Stephen Henson | f07fb9b | 2000-02-08 01:34:59 +0000 | [diff] [blame] | 60 | |
Rich Salz | dfee862 | 2018-07-03 12:45:14 -0400 | [diff] [blame] | 61 | =item B<-aes128>, B<-aes192>, B<-aes256>, B<-aria128>, B<-aria192>, B<-aria256>, B<-camellia128>, B<-camellia192>, B<-camellia256>, B<-des>, B<-des3>, B<-idea> |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 62 | |
Rich Salz | fc1d88f | 2014-07-02 22:42:40 -0400 | [diff] [blame] | 63 | These options encrypt the private key with specified |
| 64 | cipher before outputting it. If none of these options is |
Dr. Stephen Henson | f07fb9b | 2000-02-08 01:34:59 +0000 | [diff] [blame] | 65 | specified no encryption is used. If encryption is used a pass phrase is prompted |
Dr. Stephen Henson | a3fe382 | 2000-02-16 23:16:01 +0000 | [diff] [blame] | 66 | for if it is not supplied via the B<-passout> argument. |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 67 | |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 68 | =item B<-F4>|B<-3> |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 69 | |
Pauli | c4de074 | 2017-03-30 07:38:30 +1000 | [diff] [blame] | 70 | The public exponent to use, either 65537 or 3. The default is 65537. |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 71 | |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 72 | =item B<-engine> I<id> |
Richard Levitte | bfa3555 | 2003-01-30 22:02:27 +0000 | [diff] [blame] | 73 | |
Richard Levitte | 35a810b | 2019-10-01 19:43:36 +0200 | [diff] [blame] | 74 | Specifying an engine (by its unique I<id> string) will cause this command |
Richard Levitte | bfa3555 | 2003-01-30 22:02:27 +0000 | [diff] [blame] | 75 | to attempt to obtain a functional reference to the specified engine, |
| 76 | thus initialising it if needed. The engine will then be set as the default |
| 77 | for all available algorithms. |
| 78 | |
Rich Salz | e876971 | 2019-09-25 15:20:11 -0400 | [diff] [blame] | 79 | =item B<-primes> I<num> |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 80 | |
Richard Levitte | 2f0ea93 | 2019-10-01 18:16:29 +0200 | [diff] [blame] | 81 | Specify the number of primes to use while generating the RSA key. The I<num> |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 82 | parameter must be a positive integer that is greater than 1 and less than 16. |
Richard Levitte | 2f0ea93 | 2019-10-01 18:16:29 +0200 | [diff] [blame] | 83 | If I<num> is greater than 2, then the generated key is called a 'multi-prime' |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 84 | RSA key, which is defined in RFC 8017. |
| 85 | |
Philip Prindeville | c43fa56 | 2018-08-08 11:51:23 -0600 | [diff] [blame] | 86 | =item B<-verbose> |
| 87 | |
| 88 | Print extra details about the operations being performed. |
| 89 | |
Rich Salz | 9fcb970 | 2019-10-12 17:45:56 -0400 | [diff] [blame^] | 90 | {- $OpenSSL::safe::opt_r_item -} |
| 91 | |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 92 | =item B<numbits> |
| 93 | |
Pauli | c4de074 | 2017-03-30 07:38:30 +1000 | [diff] [blame] | 94 | The size of the private key to generate in bits. This must be the last option |
Sebastian Andrzej Siewior | cac19d1 | 2017-10-18 13:30:23 +0200 | [diff] [blame] | 95 | specified. The default is 2048 and values less than 512 are not allowed. |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 96 | |
| 97 | =back |
| 98 | |
| 99 | =head1 NOTES |
| 100 | |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 101 | RSA private key generation essentially involves the generation of two or more |
| 102 | prime numbers. When generating a private key various symbols will be output to |
Dr. Stephen Henson | a3fe382 | 2000-02-16 23:16:01 +0000 | [diff] [blame] | 103 | indicate the progress of the generation. A B<.> represents each number which |
| 104 | has passed an initial sieve test, B<+> means a number has passed a single |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 105 | round of the Miller-Rabin primality test, B<*> means the current prime starts |
| 106 | a regenerating progress due to some failed tests. A newline means that the number |
| 107 | has passed all the prime tests (the actual number depends on the key size). |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 108 | |
| 109 | Because key generation is a random process the time taken to generate a key |
Paul Yang | 665d899 | 2017-08-02 02:19:43 +0800 | [diff] [blame] | 110 | may vary somewhat. But in general, more primes lead to less generation time |
| 111 | of a key. |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 112 | |
Dr. Stephen Henson | aba3e65 | 1999-11-10 02:52:17 +0000 | [diff] [blame] | 113 | =head1 SEE ALSO |
| 114 | |
Dr. Matthias St. Pierre | b6b6657 | 2019-08-22 01:04:41 +0200 | [diff] [blame] | 115 | L<openssl(1)>, |
| 116 | L<openssl-gendsa(1)> |
Ulf Möller | 369782a | 2000-03-18 22:00:26 +0000 | [diff] [blame] | 117 | |
Rich Salz | e2f9261 | 2016-05-18 11:44:05 -0400 | [diff] [blame] | 118 | =head1 COPYRIGHT |
| 119 | |
Dr. Matthias St. Pierre | b6b6657 | 2019-08-22 01:04:41 +0200 | [diff] [blame] | 120 | Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. |
Rich Salz | e2f9261 | 2016-05-18 11:44:05 -0400 | [diff] [blame] | 121 | |
Richard Levitte | 449040b | 2018-12-06 14:04:11 +0100 | [diff] [blame] | 122 | Licensed under the Apache License 2.0 (the "License"). You may not use |
Rich Salz | e2f9261 | 2016-05-18 11:44:05 -0400 | [diff] [blame] | 123 | this file except in compliance with the License. You can obtain a copy |
| 124 | in the file LICENSE in the source distribution or at |
| 125 | L<https://www.openssl.org/source/license.html>. |
| 126 | |
| 127 | =cut |