Debian Codegraph @

upstream/debian-unstable/man1/openssl-rehash.1ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
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 1SSL"
58 .TH OPENSSL-REHASH 1SSL 2026-04-07 3.6.2 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\-provparam\fR \fI[name:]key=value\fR]
79 [\fB\-propquery\fR \fIpropq\fR]
80 [\fIdirectory\fR] ...
81 .PP
82 \&\fBc_rehash\fR
83 [\fB\-h\fR]
84 [\fB\-help\fR]
85 [\fB\-old\fR]
86 [\fB\-n\fR]
87 [\fB\-v\fR]
88 [\fB\-provider\fR \fIname\fR]
89 [\fB\-provider\-path\fR \fIpath\fR]
90 [\fB\-provparam\fR \fI[name:]key=value\fR]
91 [\fB\-propquery\fR \fIpropq\fR]
92 [\fIdirectory\fR] ...
93 .SH DESCRIPTION
94 .IX Header "DESCRIPTION"
95 This command is generally equivalent to the external
96 script \fBc_rehash\fR,
97 except for minor differences noted below.
98 .PP
99 \&\fBopenssl rehash\fR scans directories and calculates a hash value of
100 each \fI.pem\fR, \fI.crt\fR, \fI.cer\fR, or \fI.crl\fR
101 file in the specified directory list and creates symbolic links
102 for each file, where the name of the link is the hash value.
103 (If the platform does not support symbolic links, a copy is made.)
104 This command is useful as many programs that use OpenSSL require
105 directories to be set up like this in order to find certificates.
106 .PP
107 If any directories are named on the command line, then those are
108 processed in turn. If not, then the \fBSSL_CERT_DIR\fR environment variable
109 is consulted; this should be a colon-separated list of directories,
110 like the Unix \fBPATH\fR variable.
111 If that is not set then the default directory (installation-specific
112 but often \fI/usr/local/ssl/certs\fR) is processed.
113 .PP
114 In order for a directory to be processed, the user must have write
115 permissions on that directory, otherwise an error will be generated.
116 .PP
117 The links created are of the form \fIHHHHHHHH.D\fR, where each \fIH\fR
118 is a hexadecimal character and \fID\fR is a single decimal digit.
119 When a directory is processed, all links in it that have a name
120 in that syntax are first removed, even if they are being used for
121 some other purpose.
122 To skip the removal step, use the \fB\-n\fR flag.
123 Hashes for CRL's look similar except the letter \fBr\fR appears after
124 the period, like this: \fIHHHHHHHH.\fR\fBr\fR\fID\fR.
125 .PP
126 Multiple objects may have the same hash; they will be indicated by
127 incrementing the \fID\fR value. Duplicates are found by comparing the
128 full SHA\-1 fingerprint. A warning will be displayed if a duplicate
129 is found.
130 .PP
131 A warning will also be displayed if there are files that
132 cannot be parsed as either a certificate or a CRL or if
133 more than one such object appears in the file.
134 .SS "Script Configuration"
135 .IX Subsection "Script Configuration"
136 The \fBc_rehash\fR script
137 uses the \fBopenssl\fR program to compute the hashes and
138 fingerprints. If not found in the user's \fBPATH\fR, then set the
139 \&\fBOPENSSL\fR environment variable to the full pathname.
140 Any program can be used, it will be invoked as follows for either
141 a certificate or CRL:
142 .PP
143 .Vb 2
144 \& $OPENSSL x509 \-hash \-fingerprint \-noout \-in FILENAME
145 \& $OPENSSL crl \-hash \-fingerprint \-noout \-in FILENAME
146 .Ve
147 .PP
148 where \fIFILENAME\fR is the filename. It must output the hash of the
149 file on the first line, and the fingerprint on the second,
150 optionally prefixed with some text and an equals sign.
151 .SH OPTIONS
152 .IX Header "OPTIONS"
153 .IP "\fB\-help\fR \fB\-h\fR" 4
154 .IX Item "-help -h"
155 Display a brief usage message.
156 .IP \fB\-old\fR 4
157 .IX Item "-old"
158 Use old-style hashing (MD5, as opposed to SHA\-1) for generating
159 links to be used for releases before 1.0.0.
160 Note that current versions will not use the old style.
161 .IP \fB\-n\fR 4
162 .IX Item "-n"
163 Do not remove existing links.
164 This is needed when keeping new and old-style links in the same directory.
165 .IP \fB\-compat\fR 4
166 .IX Item "-compat"
167 Generate links for both old-style (MD5) and new-style (SHA1) hashing.
168 This allows releases before 1.0.0 to use these links along-side newer
169 releases.
170 .IP \fB\-v\fR 4
171 .IX Item "-v"
172 Print messages about old links removed and new links created.
173 By default, this command only lists each directory as it is processed.
174 .IP "\fB\-provider\fR \fIname\fR" 4
175 .IX Item "-provider name"
176 .PD 0
177 .IP "\fB\-provider\-path\fR \fIpath\fR" 4
178 .IX Item "-provider-path path"
179 .IP "\fB\-provparam\fR \fI[name:]key=value\fR" 4
180 .IX Item "-provparam [name:]key=value"
181 .IP "\fB\-propquery\fR \fIpropq\fR" 4
182 .IX Item "-propquery propq"
183 .PD
184 See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
185 .SH ENVIRONMENT
186 .IX Header "ENVIRONMENT"
187 .IP \fBOPENSSL\fR 4
188 .IX Item "OPENSSL"
189 The path to an executable to use to generate hashes and
190 fingerprints (see above).
191 .IP \fBPATH\fR 4
192 .IX Item "PATH"
193 List of paths, separated by colons (or semicolons, on Windows platforms),
194 where the \fBopenssl\fR executable is searched in case the path to the hash
195 generating executable is not provided in the \fBOPENSSL\fR environment variable
196 or it is not usable (that is, does not exist or is not executable).
197 .IP \fBSSL_CERT_DIR\fR 4
198 .IX Item "SSL_CERT_DIR"
199 Colon separated list of directories to operate on.
200 Ignored if directories are listed on the command line.
201 .SH "SEE ALSO"
202 .IX Header "SEE ALSO"
203 \&\fBopenssl\fR\|(1),
204 \&\fBopenssl\-crl\fR\|(1),
205 \&\fBopenssl\-x509\fR\|(1)
206 .SH COPYRIGHT
207 .IX Header "COPYRIGHT"
208 Copyright 2015\-2025 The OpenSSL Project Authors. All Rights Reserved.
209 .PP
210 Licensed under the Apache License 2.0 (the "License"). You may not use
211 this file except in compliance with the License. You can obtain a copy
212 in the file LICENSE in the source distribution or at
213 <https://www.openssl.org/source/license.html>.