dhparam.pod 3.7 KB

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