]> git.ipfire.org Git - thirdparty/openssl.git/blob - doc/man1/openssl-genrsa.pod
Refactor many common flags into openssl.pod
[thirdparty/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> I<filename>]
12 [B<-passout> I<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>|B<-3>]
26 [B<-rand> I<files>]
27 [B<-writerand> I<file>]
28 [B<-engine> I<id>]
29 [B<-primes> I<num>]
30 [B<-verbose>]
31 [B<numbits>]
32
33 =for openssl ifdef engine
34
35 =head1 DESCRIPTION
36
37 This command generates an RSA private key.
38
39 =head1 OPTIONS
40
41 =over 4
42
43 =item B<-help>
44
45 Print out a usage message.
46
47 =item B<-out> I<filename>
48
49 Output the key to the specified file. If this argument is not specified then
50 standard output is used.
51
52 =item B<-passout> I<arg>
53
54 The output file password source. For more information about the format
55 see L<openssl(1)/Pass Phrase Options>.
56
57 =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>
58
59 These options encrypt the private key with specified
60 cipher before outputting it. If none of these options is
61 specified no encryption is used. If encryption is used a pass phrase is prompted
62 for if it is not supplied via the B<-passout> argument.
63
64 =item B<-F4>|B<-3>
65
66 The public exponent to use, either 65537 or 3. The default is 65537.
67
68 =item B<-rand> I<files>, B<-writerand> I<file>
69
70 See L<openssl(1)/Random State Options> for more information.
71
72 =item B<-engine> I<id>
73
74 Specifying an engine (by its unique I<id> string) will cause this command
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
79 =item B<-primes> I<num>
80
81 Specify the number of primes to use while generating the RSA key. The I<num>
82 parameter must be a positive integer that is greater than 1 and less than 16.
83 If I<num> is greater than 2, then the generated key is called a 'multi-prime'
84 RSA key, which is defined in RFC 8017.
85
86 =item B<-verbose>
87
88 Print extra details about the operations being performed.
89
90 =item B<numbits>
91
92 The size of the private key to generate in bits. This must be the last option
93 specified. The default is 2048 and values less than 512 are not allowed.
94
95 =back
96
97 =head1 NOTES
98
99 RSA private key generation essentially involves the generation of two or more
100 prime numbers. When generating a private key various symbols will be output to
101 indicate the progress of the generation. A B<.> represents each number which
102 has passed an initial sieve test, B<+> means a number has passed a single
103 round of the Miller-Rabin primality test, B<*> means the current prime starts
104 a regenerating progress due to some failed tests. A newline means that the number
105 has passed all the prime tests (the actual number depends on the key size).
106
107 Because key generation is a random process the time taken to generate a key
108 may vary somewhat. But in general, more primes lead to less generation time
109 of a key.
110
111 =head1 SEE ALSO
112
113 L<openssl(1)>,
114 L<openssl-gendsa(1)>
115
116 =head1 COPYRIGHT
117
118 Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
119
120 Licensed under the Apache License 2.0 (the "License"). You may not use
121 this file except in compliance with the License. You can obtain a copy
122 in the file LICENSE in the source distribution or at
123 L<https://www.openssl.org/source/license.html>.
124
125 =cut