genrsa.pod 3.6 KB

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