c_rehash.1 revision 296317
Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is turned on, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "C_REHASH 1"
C_REHASH 1 "2016-03-01" "1.0.1s" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
c_rehash - Create symbolic links to files named by the hash values
"SYNOPSIS"
Header "SYNOPSIS" \fBc_rehash [ directory...]
"DESCRIPTION"
Header "DESCRIPTION" \fBc_rehash scans directories and calculates a hash value of each \*(C`.pem\*(C' file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value. This utility is useful as many programs that use OpenSSL require directories to be set up like this in order to find certificates.

If any directories are named on the command line, then those are processed in turn. If not, then the \s-1SSL_CERT_DIR\s0 environment variable is consulted; this shold be a colon-separated list of directories, like the Unix \s-1PATH\s0 variable. If that is not set then the default directory (installation-specific but often /usr/local/ssl/certs) is processed.

In order for a directory to be processed, the user must have write permissions on that directory, otherwise it will be skipped. The links created are of the form \*(C`HHHHHHHH.D\*(C', where each H is a hexadecimal character and D is a single decimal digit. When processing a directory, c_rehash will first remove all links that have a name in that syntax. If you have links in that format used for other purposes, they will be removed. Hashes for \s-1CRL\s0's look similar except the letter r appears after the period, like this: \*(C`HHHHHHHH.rD\*(C'.

Multiple objects may have the same hash; they will be indicated by incrementing the D value. Duplicates are found by comparing the full \s-1SHA-1\s0 fingerprint. A warning will be displayed if a duplicate is found.

A warning will also be displayed if there are .pem files that cannot be parsed as either a certificate or a \s-1CRL.\s0

The program uses the openssl program to compute the hashes and fingerprints. If not found in the user's \s-1PATH\s0, then set the \fB\s-1OPENSSL\s0 environment variable to the full pathname. Any program can be used, it will be invoked as follows for either a certificate or \s-1CRL:\s0

.Vb 2 $OPENSSL x509 -hash -fingerprint -noout -in FFFFFF $OPENSSL crl -hash -fingerprint -noout -in FFFFFF .Ve

where \s-1FFFFFF\s0 is the filename. It must output the hash of the file on the first line, and the fingerprint on the second, optionally prefixed with some text and an equals sign.

"ENVIRONMENT"
Header "ENVIRONMENT"
"\s-1OPENSSL\s0" 4
Item "OPENSSL" The path to an executable to use to generate hashes and fingerprints (see above).
"\s-1SSL_CERT_DIR\s0" 4
Item "SSL_CERT_DIR" Colon separated list of directories to operate on. Ignored if directories are listed on the command line.
"SEE ALSO"
Header "SEE ALSO" \fIopenssl\|(1), \fIcrl\|(1). \fIx509\|(1).