Fix function name typo in MAC documentation.
[oweals/openssl.git] / doc / man1 / openssl-genrsa.pod
1 =pod
2
3 =head1 NAME
4
5 openssl-genrsa - generate an RSA private key
6
7 =head1 SYNOPSIS
8
9 B<openssl> B<genrsa>
10 [B<-help>]
11 [B<-out filename>]
12 [B<-passout arg>]
13 [B<-aes128>]
14 [B<-aes192>]
15 [B<-aes256>]
16 [B<-aria128>]
17 [B<-aria192>]
18 [B<-aria256>]
19 [B<-camellia128>]
20 [B<-camellia192>]
21 [B<-camellia256>]
22 [B<-des>]
23 [B<-des3>]
24 [B<-idea>]
25 [B<-f4>]
26 [B<-3>]
27 [B<-rand file...>]
28 [B<-writerand file>]
29 [B<-engine id>]
30 [B<-primes num>]
31 [B<-verbose>]
32 [B<numbits>]
33
34 =head1 DESCRIPTION
35
36 The B<genrsa> command generates an RSA private key.
37
38 =head1 OPTIONS
39
40 =over 4
41
42 =item B<-help>
43
44 Print out a usage message.
45
46 =item B<-out filename>
47
48 Output the key to the specified file. If this argument is not specified then
49 standard output is used.
50
51 =item B<-passout arg>
52
53 The output file password source. For more information about the format
54 of B<arg> see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
55
56 =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>
57
58 These options encrypt the private key with specified
59 cipher before outputting it. If none of these options is
60 specified no encryption is used. If encryption is used a pass phrase is prompted
61 for if it is not supplied via the B<-passout> argument.
62
63 =item B<-F4|-3>
64
65 The public exponent to use, either 65537 or 3. The default is 65537.
66
67 =item B<-rand file...>
68
69 A file or files containing random data used to seed the random number
70 generator.
71 Multiple files can be specified separated by an OS-dependent character.
72 The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
73 all others.
74
75 =item [B<-writerand file>]
76
77 Writes random data to the specified I<file> upon exit.
78 This can be used with a subsequent B<-rand> flag.
79
80 =item B<-engine id>
81
82 Specifying an engine (by its unique B<id> string) will cause B<genrsa>
83 to attempt to obtain a functional reference to the specified engine,
84 thus initialising it if needed. The engine will then be set as the default
85 for all available algorithms.
86
87 =item B<-primes num>
88
89 Specify the number of primes to use while generating the RSA key. The B<num>
90 parameter must be a positive integer that is greater than 1 and less than 16.
91 If B<num> is greater than 2, then the generated key is called a 'multi-prime'
92 RSA key, which is defined in RFC 8017.
93
94 =item B<-verbose>
95
96 Print extra details about the operations being performed.
97
98 =item B<numbits>
99
100 The size of the private key to generate in bits. This must be the last option
101 specified. The default is 2048 and values less than 512 are not allowed.
102
103 =back
104
105 =head1 NOTES
106
107 RSA private key generation essentially involves the generation of two or more
108 prime numbers. When generating a private key various symbols will be output to
109 indicate the progress of the generation. A B<.> represents each number which
110 has passed an initial sieve test, B<+> means a number has passed a single
111 round of the Miller-Rabin primality test, B<*> means the current prime starts
112 a regenerating progress due to some failed tests. A newline means that the number
113 has passed all the prime tests (the actual number depends on the key size).
114
115 Because key generation is a random process the time taken to generate a key
116 may vary somewhat. But in general, more primes lead to less generation time
117 of a key.
118
119 =head1 SEE ALSO
120
121 L<openssl(1)>,
122 L<openssl-gendsa(1)>
123
124 =head1 COPYRIGHT
125
126 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
127
128 Licensed under the Apache License 2.0 (the "License").  You may not use
129 this file except in compliance with the License.  You can obtain a copy
130 in the file LICENSE in the source distribution or at
131 L<https://www.openssl.org/source/license.html>.
132
133 =cut