openssl-genrsa.1ossl 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL-GENRSA 1ossl"
  58. .TH OPENSSL-GENRSA 1ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. openssl\-genrsa \- generate an RSA private key
  65. .SH SYNOPSIS
  66. .IX Header "SYNOPSIS"
  67. \&\fBopenssl\fR \fBgenrsa\fR
  68. [\fB\-help\fR]
  69. [\fB\-out\fR \fIfilename\fR]
  70. [\fB\-passout\fR \fIarg\fR]
  71. [\fB\-aes128\fR]
  72. [\fB\-aes192\fR]
  73. [\fB\-aes256\fR]
  74. [\fB\-aria128\fR]
  75. [\fB\-aria192\fR]
  76. [\fB\-aria256\fR]
  77. [\fB\-camellia128\fR]
  78. [\fB\-camellia192\fR]
  79. [\fB\-camellia256\fR]
  80. [\fB\-des\fR]
  81. [\fB\-des3\fR]
  82. [\fB\-idea\fR]
  83. [\fB\-F4\fR]
  84. [\fB\-f4\fR]
  85. [\fB\-3\fR]
  86. [\fB\-primes\fR \fInum\fR]
  87. [\fB\-verbose\fR]
  88. [\fB\-quiet\fR]
  89. [\fB\-traditional\fR]
  90. [\fB\-rand\fR \fIfiles\fR]
  91. [\fB\-writerand\fR \fIfile\fR]
  92. [\fB\-engine\fR \fIid\fR]
  93. [\fB\-provider\fR \fIname\fR]
  94. [\fB\-provider\-path\fR \fIpath\fR]
  95. [\fB\-propquery\fR \fIpropq\fR]
  96. [\fBnumbits\fR]
  97. .SH DESCRIPTION
  98. .IX Header "DESCRIPTION"
  99. This command generates an RSA private key.
  100. .SH OPTIONS
  101. .IX Header "OPTIONS"
  102. .IP \fB\-help\fR 4
  103. .IX Item "-help"
  104. Print out a usage message.
  105. .IP "\fB\-out\fR \fIfilename\fR" 4
  106. .IX Item "-out filename"
  107. Output the key to the specified file. If this argument is not specified then
  108. standard output is used.
  109. .IP "\fB\-passout\fR \fIarg\fR" 4
  110. .IX Item "-passout arg"
  111. The output file password source. For more information about the format
  112. see \fBopenssl\-passphrase\-options\fR\|(1).
  113. .IP "\fB\-aes128\fR, \fB\-aes192\fR, \fB\-aes256\fR, \fB\-aria128\fR, \fB\-aria192\fR, \fB\-aria256\fR, \fB\-camellia128\fR, \fB\-camellia192\fR, \fB\-camellia256\fR, \fB\-des\fR, \fB\-des3\fR, \fB\-idea\fR" 4
  114. .IX Item "-aes128, -aes192, -aes256, -aria128, -aria192, -aria256, -camellia128, -camellia192, -camellia256, -des, -des3, -idea"
  115. These options encrypt the private key with specified
  116. cipher before outputting it. If none of these options is
  117. specified no encryption is used. If encryption is used a pass phrase is prompted
  118. for if it is not supplied via the \fB\-passout\fR argument.
  119. .IP "\fB\-F4\fR, \fB\-f4\fR, \fB\-3\fR" 4
  120. .IX Item "-F4, -f4, -3"
  121. The public exponent to use, either 65537 or 3. The default is 65537.
  122. The \fB\-3\fR option has been deprecated.
  123. .IP "\fB\-primes\fR \fInum\fR" 4
  124. .IX Item "-primes num"
  125. Specify the number of primes to use while generating the RSA key. The \fInum\fR
  126. parameter must be a positive integer that is greater than 1 and less than 16.
  127. If \fInum\fR is greater than 2, then the generated key is called a 'multi\-prime'
  128. RSA key, which is defined in RFC 8017.
  129. .IP \fB\-verbose\fR 4
  130. .IX Item "-verbose"
  131. Print extra details about the operations being performed.
  132. .IP \fB\-quiet\fR 4
  133. .IX Item "-quiet"
  134. Print fewer details about the operations being performed, which may
  135. be handy during batch scripts and pipelines.
  136. .IP \fB\-traditional\fR 4
  137. .IX Item "-traditional"
  138. Write the key using the traditional PKCS#1 format instead of the PKCS#8 format.
  139. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
  140. .IX Item "-rand files, -writerand file"
  141. See "Random State Options" in \fBopenssl\fR\|(1) for details.
  142. .IP "\fB\-engine\fR \fIid\fR" 4
  143. .IX Item "-engine id"
  144. See "Engine Options" in \fBopenssl\fR\|(1).
  145. This option is deprecated.
  146. .IP "\fB\-provider\fR \fIname\fR" 4
  147. .IX Item "-provider name"
  148. .PD 0
  149. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  150. .IX Item "-provider-path path"
  151. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  152. .IX Item "-propquery propq"
  153. .PD
  154. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  155. .IP \fBnumbits\fR 4
  156. .IX Item "numbits"
  157. The size of the private key to generate in bits. This must be the last option
  158. specified. The default is 2048 and values less than 512 are not allowed.
  159. .SH NOTES
  160. .IX Header "NOTES"
  161. RSA private key generation essentially involves the generation of two or more
  162. prime numbers. When generating a private key various symbols will be output to
  163. indicate the progress of the generation. A \fB.\fR represents each number which
  164. has passed an initial sieve test, \fB+\fR means a number has passed a single
  165. round of the Miller-Rabin primality test, \fB*\fR means the current prime starts
  166. a regenerating progress due to some failed tests. A newline means that the number
  167. has passed all the prime tests (the actual number depends on the key size).
  168. .PP
  169. Because key generation is a random process the time taken to generate a key
  170. may vary somewhat. But in general, more primes lead to less generation time
  171. of a key.
  172. .SH "SEE ALSO"
  173. .IX Header "SEE ALSO"
  174. \&\fBopenssl\fR\|(1),
  175. \&\fBopenssl\-genpkey\fR\|(1),
  176. \&\fBopenssl\-gendsa\fR\|(1)
  177. .SH COPYRIGHT
  178. .IX Header "COPYRIGHT"
  179. Copyright 2000\-2023 The OpenSSL Project Authors. All Rights Reserved.
  180. .PP
  181. Licensed under the Apache License 2.0 (the "License"). You may not use
  182. this file except in compliance with the License. You can obtain a copy
  183. in the file LICENSE in the source distribution or at
  184. <https://www.openssl.org/source/license.html>.