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