dhparam.pod 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. 2 is the default. If present then the
  52. input file is ignored and parameters are generated instead.
  53. =item B<-rand> I<file(s)>
  54. a file or files containing random data used to seed the random number
  55. generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
  56. Multiple files can be specified separated by a OS-dependent character.
  57. The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
  58. all others.
  59. =item I<numbits>
  60. this option specifies that a parameter set should be generated of size
  61. I<numbits>. It must be the last option. If not present then a value of 512
  62. is used. If this option is present then the input file is ignored and
  63. parameters are generated instead.
  64. =item B<-noout>
  65. this option inhibits the output of the encoded version of the parameters.
  66. =item B<-text>
  67. this option prints out the DH parameters in human readable form.
  68. =item B<-C>
  69. this option converts the parameters into C code. The parameters can then
  70. be loaded by calling the B<get_dh>I<numbits>B<()> function.
  71. =item B<-engine id>
  72. specifying an engine (by its unique B<id> string) will cause B<dhparam>
  73. to attempt to obtain a functional reference to the specified engine,
  74. thus initialising it if needed. The engine will then be set as the default
  75. for all available algorithms.
  76. =back
  77. =head1 WARNINGS
  78. The program B<dhparam> combines the functionality of the programs B<dh> and
  79. B<gendh> in previous versions of OpenSSL and SSLeay. The B<dh> and B<gendh>
  80. programs are retained for now but may have different purposes in future
  81. versions of OpenSSL.
  82. =head1 NOTES
  83. PEM format DH parameters use the header and footer lines:
  84. -----BEGIN DH PARAMETERS-----
  85. -----END DH PARAMETERS-----
  86. OpenSSL currently only supports the older PKCS#3 DH, not the newer X9.42
  87. DH.
  88. This program manipulates DH parameters not keys.
  89. =head1 BUGS
  90. There should be a way to generate and manipulate DH keys.
  91. =head1 SEE ALSO
  92. L<dsaparam(1)|dsaparam(1)>
  93. =head1 HISTORY
  94. The B<dhparam> command was added in OpenSSL 0.9.5.
  95. The B<-dsaparam> option was added in OpenSSL 0.9.6.
  96. =cut