openssl-rehash.1ossl 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL-REHASH 1ossl"
  58. .TH OPENSSL-REHASH 1ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. openssl\-rehash, c_rehash \- Create symbolic links to files named by the hash
  65. values
  66. .SH SYNOPSIS
  67. .IX Header "SYNOPSIS"
  68. \&\fBopenssl\fR
  69. \&\fBrehash\fR
  70. [\fB\-h\fR]
  71. [\fB\-help\fR]
  72. [\fB\-old\fR]
  73. [\fB\-compat\fR]
  74. [\fB\-n\fR]
  75. [\fB\-v\fR]
  76. [\fB\-provider\fR \fIname\fR]
  77. [\fB\-provider\-path\fR \fIpath\fR]
  78. [\fB\-propquery\fR \fIpropq\fR]
  79. [\fIdirectory\fR] ...
  80. .PP
  81. \&\fBc_rehash\fR
  82. [\fB\-h\fR]
  83. [\fB\-help\fR]
  84. [\fB\-old\fR]
  85. [\fB\-n\fR]
  86. [\fB\-v\fR]
  87. [\fB\-provider\fR \fIname\fR]
  88. [\fB\-provider\-path\fR \fIpath\fR]
  89. [\fB\-propquery\fR \fIpropq\fR]
  90. [\fIdirectory\fR] ...
  91. .SH DESCRIPTION
  92. .IX Header "DESCRIPTION"
  93. This command is generally equivalent to the external
  94. script \fBc_rehash\fR,
  95. except for minor differences noted below.
  96. .PP
  97. \&\fBopenssl rehash\fR scans directories and calculates a hash value of
  98. each \fI.pem\fR, \fI.crt\fR, \fI.cer\fR, or \fI.crl\fR
  99. file in the specified directory list and creates symbolic links
  100. for each file, where the name of the link is the hash value.
  101. (If the platform does not support symbolic links, a copy is made.)
  102. This command is useful as many programs that use OpenSSL require
  103. directories to be set up like this in order to find certificates.
  104. .PP
  105. If any directories are named on the command line, then those are
  106. processed in turn. If not, then the \fBSSL_CERT_DIR\fR environment variable
  107. is consulted; this should be a colon-separated list of directories,
  108. like the Unix \fBPATH\fR variable.
  109. If that is not set then the default directory (installation-specific
  110. but often \fI/usr/local/ssl/certs\fR) is processed.
  111. .PP
  112. In order for a directory to be processed, the user must have write
  113. permissions on that directory, otherwise an error will be generated.
  114. .PP
  115. The links created are of the form \fIHHHHHHHH.D\fR, where each \fIH\fR
  116. is a hexadecimal character and \fID\fR is a single decimal digit.
  117. When a directory is processed, all links in it that have a name
  118. in that syntax are first removed, even if they are being used for
  119. some other purpose.
  120. To skip the removal step, use the \fB\-n\fR flag.
  121. Hashes for CRL's look similar except the letter \fBr\fR appears after
  122. the period, like this: \fIHHHHHHHH.\fR\fBr\fR\fID\fR.
  123. .PP
  124. Multiple objects may have the same hash; they will be indicated by
  125. incrementing the \fID\fR value. Duplicates are found by comparing the
  126. full SHA\-1 fingerprint. A warning will be displayed if a duplicate
  127. is found.
  128. .PP
  129. A warning will also be displayed if there are files that
  130. cannot be parsed as either a certificate or a CRL or if
  131. more than one such object appears in the file.
  132. .SS "Script Configuration"
  133. .IX Subsection "Script Configuration"
  134. The \fBc_rehash\fR script
  135. uses the \fBopenssl\fR program to compute the hashes and
  136. fingerprints. If not found in the user's \fBPATH\fR, then set the
  137. \&\fBOPENSSL\fR environment variable to the full pathname.
  138. Any program can be used, it will be invoked as follows for either
  139. a certificate or CRL:
  140. .PP
  141. .Vb 2
  142. \& $OPENSSL x509 \-hash \-fingerprint \-noout \-in FILENAME
  143. \& $OPENSSL crl \-hash \-fingerprint \-noout \-in FILENAME
  144. .Ve
  145. .PP
  146. where \fIFILENAME\fR is the filename. It must output the hash of the
  147. file on the first line, and the fingerprint on the second,
  148. optionally prefixed with some text and an equals sign.
  149. .SH OPTIONS
  150. .IX Header "OPTIONS"
  151. .IP "\fB\-help\fR \fB\-h\fR" 4
  152. .IX Item "-help -h"
  153. Display a brief usage message.
  154. .IP \fB\-old\fR 4
  155. .IX Item "-old"
  156. Use old-style hashing (MD5, as opposed to SHA\-1) for generating
  157. links to be used for releases before 1.0.0.
  158. Note that current versions will not use the old style.
  159. .IP \fB\-n\fR 4
  160. .IX Item "-n"
  161. Do not remove existing links.
  162. This is needed when keeping new and old-style links in the same directory.
  163. .IP \fB\-compat\fR 4
  164. .IX Item "-compat"
  165. Generate links for both old-style (MD5) and new-style (SHA1) hashing.
  166. This allows releases before 1.0.0 to use these links along-side newer
  167. releases.
  168. .IP \fB\-v\fR 4
  169. .IX Item "-v"
  170. Print messages about old links removed and new links created.
  171. By default, this command only lists each directory as it is processed.
  172. .IP "\fB\-provider\fR \fIname\fR" 4
  173. .IX Item "-provider name"
  174. .PD 0
  175. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  176. .IX Item "-provider-path path"
  177. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  178. .IX Item "-propquery propq"
  179. .PD
  180. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  181. .SH ENVIRONMENT
  182. .IX Header "ENVIRONMENT"
  183. .IP \fBOPENSSL\fR 4
  184. .IX Item "OPENSSL"
  185. The path to an executable to use to generate hashes and
  186. fingerprints (see above).
  187. .IP \fBSSL_CERT_DIR\fR 4
  188. .IX Item "SSL_CERT_DIR"
  189. Colon separated list of directories to operate on.
  190. Ignored if directories are listed on the command line.
  191. .SH "SEE ALSO"
  192. .IX Header "SEE ALSO"
  193. \&\fBopenssl\fR\|(1),
  194. \&\fBopenssl\-crl\fR\|(1),
  195. \&\fBopenssl\-x509\fR\|(1)
  196. .SH COPYRIGHT
  197. .IX Header "COPYRIGHT"
  198. Copyright 2015\-2020 The OpenSSL Project Authors. All Rights Reserved.
  199. .PP
  200. Licensed under the Apache License 2.0 (the "License"). You may not use
  201. this file except in compliance with the License. You can obtain a copy
  202. in the file LICENSE in the source distribution or at
  203. <https://www.openssl.org/source/license.html>.