xref: /onnv-gate/usr/src/common/openssl/doc/apps/genrsa.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948genrsa - generate an RSA private key
6*2175Sjp161948
7*2175Sjp161948=head1 SYNOPSIS
8*2175Sjp161948
9*2175Sjp161948B<openssl> B<genrsa>
10*2175Sjp161948[B<-out filename>]
11*2175Sjp161948[B<-passout arg>]
12*2175Sjp161948[B<-des>]
13*2175Sjp161948[B<-des3>]
14*2175Sjp161948[B<-idea>]
15*2175Sjp161948[B<-f4>]
16*2175Sjp161948[B<-3>]
17*2175Sjp161948[B<-rand file(s)>]
18*2175Sjp161948[B<-engine id>]
19*2175Sjp161948[B<numbits>]
20*2175Sjp161948
21*2175Sjp161948=head1 DESCRIPTION
22*2175Sjp161948
23*2175Sjp161948The B<genrsa> command generates an RSA private key.
24*2175Sjp161948
25*2175Sjp161948=head1 OPTIONS
26*2175Sjp161948
27*2175Sjp161948=over 4
28*2175Sjp161948
29*2175Sjp161948=item B<-out filename>
30*2175Sjp161948
31*2175Sjp161948the output filename. If this argument is not specified then standard output is
32*2175Sjp161948used.
33*2175Sjp161948
34*2175Sjp161948=item B<-passout arg>
35*2175Sjp161948
36*2175Sjp161948the output file password source. For more information about the format of B<arg>
37*2175Sjp161948see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
38*2175Sjp161948
39*2175Sjp161948=item B<-des|-des3|-idea>
40*2175Sjp161948
41*2175Sjp161948These options encrypt the private key with the DES, triple DES, or the
42*2175Sjp161948IDEA ciphers respectively before outputting it. If none of these options is
43*2175Sjp161948specified no encryption is used. If encryption is used a pass phrase is prompted
44*2175Sjp161948for if it is not supplied via the B<-passout> argument.
45*2175Sjp161948
46*2175Sjp161948=item B<-F4|-3>
47*2175Sjp161948
48*2175Sjp161948the public exponent to use, either 65537 or 3. The default is 65537.
49*2175Sjp161948
50*2175Sjp161948=item B<-rand file(s)>
51*2175Sjp161948
52*2175Sjp161948a file or files containing random data used to seed the random number
53*2175Sjp161948generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
54*2175Sjp161948Multiple files can be specified separated by a OS-dependent character.
55*2175Sjp161948The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
56*2175Sjp161948all others.
57*2175Sjp161948
58*2175Sjp161948=item B<-engine id>
59*2175Sjp161948
60*2175Sjp161948specifying an engine (by it's unique B<id> string) will cause B<req>
61*2175Sjp161948to attempt to obtain a functional reference to the specified engine,
62*2175Sjp161948thus initialising it if needed. The engine will then be set as the default
63*2175Sjp161948for all available algorithms.
64*2175Sjp161948
65*2175Sjp161948=item B<numbits>
66*2175Sjp161948
67*2175Sjp161948the size of the private key to generate in bits. This must be the last option
68*2175Sjp161948specified. The default is 512.
69*2175Sjp161948
70*2175Sjp161948=back
71*2175Sjp161948
72*2175Sjp161948=head1 NOTES
73*2175Sjp161948
74*2175Sjp161948RSA private key generation essentially involves the generation of two prime
75*2175Sjp161948numbers. When generating a private key various symbols will be output to
76*2175Sjp161948indicate the progress of the generation. A B<.> represents each number which
77*2175Sjp161948has passed an initial sieve test, B<+> means a number has passed a single
78*2175Sjp161948round of the Miller-Rabin primality test. A newline means that the number has
79*2175Sjp161948passed all the prime tests (the actual number depends on the key size).
80*2175Sjp161948
81*2175Sjp161948Because key generation is a random process the time taken to generate a key
82*2175Sjp161948may vary somewhat.
83*2175Sjp161948
84*2175Sjp161948=head1 BUGS
85*2175Sjp161948
86*2175Sjp161948A quirk of the prime generation algorithm is that it cannot generate small
87*2175Sjp161948primes. Therefore the number of bits should not be less that 64. For typical
88*2175Sjp161948private keys this will not matter because for security reasons they will
89*2175Sjp161948be much larger (typically 1024 bits).
90*2175Sjp161948
91*2175Sjp161948=head1 SEE ALSO
92*2175Sjp161948
93*2175Sjp161948L<gendsa(1)|gendsa(1)>
94*2175Sjp161948
95*2175Sjp161948=cut
96*2175Sjp161948
97