genrsa.pod 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. =pod
  2. =head1 NAME
  3. genrsa - generate an RSA private key
  4. =head1 SYNOPSIS
  5. B<openssl> B<genrsa>
  6. [B<-help>]
  7. [B<-out filename>]
  8. [B<-passout arg>]
  9. [B<-aes128>]
  10. [B<-aes192>]
  11. [B<-aes256>]
  12. [B<-aria128>]
  13. [B<-aria192>]
  14. [B<-aria256>]
  15. [B<-camellia128>]
  16. [B<-camellia192>]
  17. [B<-camellia256>]
  18. [B<-des>]
  19. [B<-des3>]
  20. [B<-idea>]
  21. [B<-f4>]
  22. [B<-3>]
  23. [B<-rand file(s)>]
  24. [B<-engine id>]
  25. [B<numbits>]
  26. =head1 DESCRIPTION
  27. The B<genrsa> command generates an RSA private key.
  28. =head1 OPTIONS
  29. =over 4
  30. =item B<-help>
  31. Print out a usage message.
  32. =item B<-out filename>
  33. Output the key to the specified file. If this argument is not specified then
  34. standard output is used.
  35. =item B<-passout arg>
  36. the output file password source. For more information about the format of B<arg>
  37. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
  38. =item B<-aes128|-aes192|-aes256|-aria128|-aria192|-aria256|-camellia128|-camellia192|-camellia256|-des|-des3|-idea>
  39. These options encrypt the private key with specified
  40. cipher before outputting it. If none of these options is
  41. specified no encryption is used. If encryption is used a pass phrase is prompted
  42. for if it is not supplied via the B<-passout> argument.
  43. =item B<-F4|-3>
  44. the public exponent to use, either 65537 or 3. The default is 65537.
  45. =item B<-rand file(s)>
  46. a file or files containing random data used to seed the random number
  47. generator, or an EGD socket (see L<RAND_egd(3)>).
  48. Multiple files can be specified separated by an OS-dependent character.
  49. The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
  50. all others.
  51. =item B<-engine id>
  52. specifying an engine (by its unique B<id> string) will cause B<genrsa>
  53. to attempt to obtain a functional reference to the specified engine,
  54. thus initialising it if needed. The engine will then be set as the default
  55. for all available algorithms.
  56. =item B<numbits>
  57. the size of the private key to generate in bits. This must be the last option
  58. specified. The default is 2048.
  59. =back
  60. =head1 NOTES
  61. RSA private key generation essentially involves the generation of two prime
  62. numbers. When generating a private key various symbols will be output to
  63. indicate the progress of the generation. A B<.> represents each number which
  64. has passed an initial sieve test, B<+> means a number has passed a single
  65. round of the Miller-Rabin primality test. A newline means that the number has
  66. passed all the prime tests (the actual number depends on the key size).
  67. Because key generation is a random process the time taken to generate a key
  68. may vary somewhat.
  69. =head1 BUGS
  70. A quirk of the prime generation algorithm is that it cannot generate small
  71. primes. Therefore the number of bits should not be less that 64. For typical
  72. private keys this will not matter because for security reasons they will
  73. be much larger (typically 1024 bits).
  74. =head1 SEE ALSO
  75. L<gendsa(1)>
  76. =head1 COPYRIGHT
  77. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  78. Licensed under the OpenSSL license (the "License"). You may not use
  79. this file except in compliance with the License. You can obtain a copy
  80. in the file LICENSE in the source distribution or at
  81. L<https://www.openssl.org/source/license.html>.
  82. =cut