dgst.pod 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. =pod
  2. =head1 NAME
  3. dgst, md5, md4, md2, sha1, sha, mdc2, ripemd160 - message digests
  4. =head1 SYNOPSIS
  5. B<openssl> B<dgst>
  6. [B<-md5|-md4|-md2|-sha1|-sha|-mdc2|-ripemd160|-dss1>]
  7. [B<-c>]
  8. [B<-d>]
  9. [B<-hex>]
  10. [B<-binary>]
  11. [B<-out filename>]
  12. [B<-sign filename>]
  13. [B<-keyform arg>]
  14. [B<-passin arg>]
  15. [B<-verify filename>]
  16. [B<-prverify filename>]
  17. [B<-signature filename>]
  18. [B<-hmac key>]
  19. [B<file...>]
  20. [B<md5|md4|md2|sha1|sha|mdc2|ripemd160>]
  21. [B<-c>]
  22. [B<-d>]
  23. [B<file...>]
  24. =head1 DESCRIPTION
  25. The digest functions output the message digest of a supplied file or files
  26. in hexadecimal form. They can also be used for digital signing and verification.
  27. =head1 OPTIONS
  28. =over 4
  29. =item B<-c>
  30. print out the digest in two digit groups separated by colons, only relevant if
  31. B<hex> format output is used.
  32. =item B<-d>
  33. print out BIO debugging information.
  34. =item B<-hex>
  35. digest is to be output as a hex dump. This is the default case for a "normal"
  36. digest as opposed to a digital signature.
  37. =item B<-binary>
  38. output the digest or signature in binary form.
  39. =item B<-out filename>
  40. filename to output to, or standard output by default.
  41. =item B<-sign filename>
  42. digitally sign the digest using the private key in "filename".
  43. =item B<-keyform arg>
  44. Specifies the key format to sign digest with. Only PEM and ENGINE
  45. formats are supported by the B<dgst> command.
  46. =item B<-engine id>
  47. Use engine B<id> for operations (including private key storage).
  48. This engine is not used as source for digest algorithms, unless it is
  49. also specified in the configuration file.
  50. =item B<-sigopt nm:v>
  51. Pass options to the signature algorithm during sign or verify operations.
  52. Names and values of these options are algorithm-specific.
  53. =item B<-passin arg>
  54. the private key password source. For more information about the format of B<arg>
  55. see the B<PASS PHRASE ARGUMENTS> section in L<openssl(1)|openssl(1)>.
  56. =item B<-verify filename>
  57. verify the signature using the the public key in "filename".
  58. The output is either "Verification OK" or "Verification Failure".
  59. =item B<-prverify filename>
  60. verify the signature using the the private key in "filename".
  61. =item B<-signature filename>
  62. the actual signature to verify.
  63. =item B<-hmac key>
  64. create a hashed MAC using "key".
  65. =item B<-mac alg>
  66. create MAC (keyed Message Authentication Code). The most popular MAC
  67. algorithm is HMAC (hash-based MAC), but there are other MAC algorithms
  68. which are not based on hash, for instance B<gost-mac> algorithm,
  69. supported by B<ccgost> engine. MAC keys and other options should be set
  70. via B<-macopt> parameter.
  71. =item B<-macopt nm:v>
  72. Passes options to MAC algorithm, specified by B<-mac> key.
  73. Following options are supported by both by B<HMAC> and B<gost-mac>:
  74. =over 8
  75. =item B<key:string>
  76. Specifies MAC key as alphnumeric string (use if key contain printable
  77. characters only). String length must conform to any restrictions of
  78. the MAC algorithm for example exactly 32 chars for gost-mac.
  79. =item B<hexkey:string>
  80. Specifies MAC key in hexadecimal form (two hex digits per byte).
  81. Key length must conform to any restrictions of the MAC algorithm
  82. for example exactly 32 chars for gost-mac.
  83. =back
  84. =item B<-rand file(s)>
  85. a file or files containing random data used to seed the random number
  86. generator, or an EGD socket (see L<RAND_egd(3)|RAND_egd(3)>).
  87. Multiple files can be specified separated by a OS-dependent character.
  88. The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
  89. all others.
  90. =item B<file...>
  91. file or files to digest. If no files are specified then standard input is
  92. used.
  93. =back
  94. =head1 NOTES
  95. The digest of choice for all new applications is SHA1. Other digests are
  96. however still widely used.
  97. If you wish to sign or verify data using the DSA algorithm then the dss1
  98. digest must be used.
  99. A source of random numbers is required for certain signing algorithms, in
  100. particular DSA.
  101. The signing and verify options should only be used if a single file is
  102. being signed or verified.
  103. =cut