4 Original text by James Westby, contributed under the OpenSSL license.
8 c_rehash - Create symbolic links to files named by the hash values
21 B<c_rehash> scans directories and calculates a hash value of each
22 C<.pem>, C<.crt>, C<.cer>, or C<.crl>
23 file in the specified directory list and creates symbolic links
24 for each file, where the name of the link is the hash value.
25 (If the platform does not support symbolic links, a copy is made.)
26 This utility is useful as many programs that use OpenSSL require
27 directories to be set up like this in order to find certificates.
29 If any directories are named on the command line, then those are
30 processed in turn. If not, then the B<SSL_CERT_DIR> environment variable
31 is consulted; this shold be a colon-separated list of directories,
32 like the Unix B<PATH> variable.
33 If that is not set then the default directory (installation-specific
34 but often B</usr/local/ssl/certs>) is processed.
36 In order for a directory to be processed, the user must have write
37 permissions on that directory, otherwise it will be skipped.
38 The links created are of the form C<HHHHHHHH.D>, where each B<H>
39 is a hexadecimal character and B<D> is a single decimal digit.
40 When processing a directory, B<c_rehash> will first remove all links
41 that have a name in that syntax. If you have links in that format
42 used for other purposes, they will be removed.
43 To skip the removal step, use the B<-n> flag.
44 Hashes for CRL's look similar except the letter B<r> appears after
45 the period, like this: C<HHHHHHHH.rD>.
47 Multiple objects may have the same hash; they will be indicated by
48 incrementing the B<D> value. Duplicates are found by comparing the
49 full SHA-1 fingerprint. A warning will be displayed if a duplicate
52 A warning will also be displayed if there are files that
53 cannot be parsed as either a certificate or a CRL.
55 The program uses the B<openssl> program to compute the hashes and
56 fingerprints. If not found in the user's B<PATH>, then set the
57 B<OPENSSL> environment variable to the full pathname.
58 Any program can be used, it will be invoked as follows for either
61 $OPENSSL x509 -hash -fingerprint -noout -in FILENAME
62 $OPENSSL crl -hash -fingerprint -noout -in FILENAME
64 where B<FILENAME> is the filename. It must output the hash of the
65 file on the first line, and the fingerprint on the second,
66 optionally prefixed with some text and an equals sign.
74 Use old-style hashing (MD5, as opposed to SHA-1) for generating
75 links for releases before 1.0.0. Note that current versions will
76 not use the old style.
80 Display a brief usage message.
84 Do not remove existing links.
85 This is needed when keeping new and old-style links in the same directory.
89 Print messages about old links removed and new links created.
90 By default, B<c_rehash> only lists each directory as it is processed.
100 The path to an executable to use to generate hashes and
101 fingerprints (see above).
103 =item B<SSL_CERT_DIR>
105 Colon separated list of directories to operate on.
106 Ignored if directories are listed on the command line.
112 L<openssl(1)|openssl(1)>,