dhparam.pod 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. =pod
  2. =head1 NAME
  3. dhparam - DH parameter manipulation and generation
  4. =head1 SYNOPSIS
  5. B<openssl dhparam>
  6. [B<-inform DER|PEM>]
  7. [B<-outform DER|PEM>]
  8. [B<-in> I<filename>]
  9. [B<-out> I<filename>]
  10. [B<-dsaparam>]
  11. [B<-check>]
  12. [B<-noout>]
  13. [B<-text>]
  14. [B<-C>]
  15. [B<-2>]
  16. [B<-5>]
  17. [B<-rand> I<file(s)>]
  18. [B<-engine id>]
  19. [I<numbits>]
  20. =head1 DESCRIPTION
  21. This command is used to manipulate DH parameter files.
  22. =head1 OPTIONS
  23. =over 4
  24. =item B<-inform DER|PEM>
  25. This specifies the input format. The B<DER> option uses an ASN1 DER encoded
  26. form compatible with the PKCS#3 DHparameter structure. The PEM form is the
  27. default format: it consists of the B<DER> format base64 encoded with
  28. additional header and footer lines.
  29. =item B<-outform DER|PEM>
  30. This specifies the output format, the options have the same meaning as the
  31. B<-inform> option.
  32. =item B<-in> I<filename>
  33. This specifies the input filename to read parameters from or standard input if
  34. this option is not specified.
  35. =item B<-out> I<filename>
  36. This specifies the output filename parameters to. Standard output is used
  37. if this option is not present. The output filename should B<not> be the same
  38. as the input filename.
  39. =item B<-dsaparam>
  40. If this option is used, DSA rather than DH parameters are read or created;
  41. they are converted to DH format. Otherwise, "strong" primes (such
  42. that (p-1)/2 is also prime) will be used for DH parameter generation.
  43. DH parameter generation with the B<-dsaparam> option is much faster,
  44. and the recommended exponent length is shorter, which makes DH key
  45. exchange more efficient. Beware that with such DSA-style DH
  46. parameters, a fresh DH key should be created for each use to
  47. avoid small-subgroup attacks that may be possible otherwise.
  48. =item B<-check>
  49. check if the parameters are valid primes and generator.
  50. =item B<-2>, B<-5>
  51. The generator to use, either 2 or 5. If present then the
  52. input file is ignored and parameters are generated instead. If not
  53. present but B<numbits> is present, parameters are generated with the
  54. default generator 2.
  55. =item B<-rand> I<file(s)>
  56. a file or files containing random data used to seed the random number
  57. generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
  58. Multiple files can be specified separated by a OS-dependent character.
  59. The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
  60. all others.
  61. =item I<numbits>
  62. this option specifies that a parameter set should be generated of size
  63. I<numbits>. It must be the last option. If this option is present then
  64. the input file is ignored and parameters are generated instead. If
  65. this option is not present but a generator (B<-2> or B<-5>) is
  66. present, parameters are generated with a default length of 2048 bits.
  67. =item B<-noout>
  68. this option inhibits the output of the encoded version of the parameters.
  69. =item B<-text>
  70. this option prints out the DH parameters in human readable form.
  71. =item B<-C>
  72. this option converts the parameters into C code. The parameters can then
  73. be loaded by calling the B<get_dh>I<numbits>B<()> function.
  74. =item B<-engine id>
  75. specifying an engine (by its unique B<id> string) will cause B<dhparam>
  76. to attempt to obtain a functional reference to the specified engine,
  77. thus initialising it if needed. The engine will then be set as the default
  78. for all available algorithms.
  79. =back
  80. =head1 WARNINGS
  81. The program B<dhparam> combines the functionality of the programs B<dh> and
  82. B<gendh> in previous versions of OpenSSL and SSLeay. The B<dh> and B<gendh>
  83. programs are retained for now but may have different purposes in future
  84. versions of OpenSSL.
  85. =head1 NOTES
  86. PEM format DH parameters use the header and footer lines:
  87. -----BEGIN DH PARAMETERS-----
  88. -----END DH PARAMETERS-----
  89. OpenSSL currently only supports the older PKCS#3 DH, not the newer X9.42
  90. DH.
  91. This program manipulates DH parameters not keys.
  92. =head1 BUGS
  93. There should be a way to generate and manipulate DH keys.
  94. =head1 SEE ALSO
  95. L<dsaparam(1)|dsaparam(1)>
  96. =head1 HISTORY
  97. The B<dhparam> command was added in OpenSSL 0.9.5.
  98. The B<-dsaparam> option was added in OpenSSL 0.9.6.
  99. =cut