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