1C_REHASH(1) OpenSSL C_REHASH(1)
2
3
4
6 c_rehash - Create symbolic links to files named by the hash values
7
9 c_rehash [-old] [-h] [-n] [-v] [ directory...]
10
12 c_rehash scans directories and calculates a hash value of each ".pem",
13 ".crt", ".cer", or ".crl" file in the specified directory list and
14 creates symbolic links for each file, where the name of the link is the
15 hash value. (If the platform does not support symbolic links, a copy
16 is made.) This utility is useful as many programs that use OpenSSL
17 require directories to be set up like this in order to find
18 certificates.
19
20 If any directories are named on the command line, then those are
21 processed in turn. If not, then the SSL_CERT_DIR environment variable
22 is consulted; this shold be a colon-separated list of directories, like
23 the Unix PATH variable. If that is not set then the default directory
24 (installation-specific but often /usr/local/ssl/certs) is processed.
25
26 In order for a directory to be processed, the user must have write
27 permissions on that directory, otherwise it will be skipped. The links
28 created are of the form "HHHHHHHH.D", where each H is a hexadecimal
29 character and D is a single decimal digit. When processing a
30 directory, c_rehash will first remove all links that have a name in
31 that syntax. If you have links in that format used for other purposes,
32 they will be removed. To skip the removal step, use the -n flag.
33 Hashes for CRL's look similar except the letter r appears after the
34 period, like this: "HHHHHHHH.rD".
35
36 Multiple objects may have the same hash; they will be indicated by
37 incrementing the D value. Duplicates are found by comparing the full
38 SHA-1 fingerprint. A warning will be displayed if a duplicate is found.
39
40 A warning will also be displayed if there are files that cannot be
41 parsed as either a certificate or a CRL.
42
43 The program uses the openssl program to compute the hashes and
44 fingerprints. If not found in the user's PATH, then set the OPENSSL
45 environment variable to the full pathname. Any program can be used, it
46 will be invoked as follows for either a certificate or CRL:
47
48 $OPENSSL x509 -hash -fingerprint -noout -in FILENAME
49 $OPENSSL crl -hash -fingerprint -noout -in FILENAME
50
51 where FILENAME is the filename. It must output the hash of the file on
52 the first line, and the fingerprint on the second, optionally prefixed
53 with some text and an equals sign.
54
56 -old
57 Use old-style hashing (MD5, as opposed to SHA-1) for generating
58 links for releases before 1.0.0. Note that current versions will
59 not use the old style.
60
61 -h Display a brief usage message.
62
63 -n Do not remove existing links. This is needed when keeping new and
64 old-style links in the same directory.
65
66 -v Print messages about old links removed and new links created. By
67 default, c_rehash only lists each directory as it is processed.
68
70 OPENSSL
71 The path to an executable to use to generate hashes and
72 fingerprints (see above).
73
74 SSL_CERT_DIR
75 Colon separated list of directories to operate on. Ignored if
76 directories are listed on the command line.
77
79 openssl(1), crl(1). x509(1).
80
81
82
831.0.2k 2017-01-26 C_REHASH(1)