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