xref: /freebsd/secure/usr.bin/openssl/man/openssl-rehash.1 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)

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 >0, 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 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 "OPENSSL-REHASH 1ossl"
OPENSSL-REHASH 1ossl "2023-09-22" "3.0.11" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
openssl-rehash, c_rehash - Create symbolic links to files named by the hash values
"SYNOPSIS"
Header "SYNOPSIS" \fBopenssl \fBrehash [-h] [-help] [-old] [-compat] [-n] [-v] [-provider name] [-provider-path path] [-propquery propq] [directory] ...

\fBc_rehash [-h] [-help] [-old] [-n] [-v] [-provider name] [-provider-path path] [-propquery propq] [directory] ...

"DESCRIPTION"
Header "DESCRIPTION" This command is generally equivalent to the external script c_rehash, except for minor differences noted below.

\fBopenssl rehash scans directories and calculates a hash value of each .pem, .crt, .cer, or .crl file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value. (If the platform does not support symbolic links, a copy is made.) This command 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 should 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 /etc/ssl/certs) is processed.

In order for a directory to be processed, the user must have write permissions on that directory, otherwise an error will be generated.

The links created are of the form \s-1HHHHHHHH.D\s0, where each H is a hexadecimal character and D is a single decimal digit. When a directory is processed, all links in it that have a name in that syntax are first removed, even if they are being used for some other purpose. To skip the removal step, use the -n flag. Hashes for \s-1CRL\s0's look similar except the letter r appears after the period, like this: \s-1HHHHHHHH.\s0rD.

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 files that cannot be parsed as either a certificate or a \s-1CRL\s0 or if more than one such object appears in the file.

"Script Configuration"
Subsection "Script Configuration" The c_rehash script 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 FILENAME $OPENSSL crl -hash -fingerprint -noout -in FILENAME .Ve

where \s-1FILENAME\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.

"OPTIONS"
Header "OPTIONS"
"-help -h" 4
Item "-help -h" Display a brief usage message.
"-old" 4
Item "-old" Use old-style hashing (\s-1MD5,\s0 as opposed to \s-1SHA-1\s0) for generating links to be used for releases before 1.0.0. Note that current versions will not use the old style.
"-n" 4
Item "-n" Do not remove existing links. This is needed when keeping new and old-style links in the same directory.
"-compat" 4
Item "-compat" Generate links for both old-style (\s-1MD5\s0) and new-style (\s-1SHA1\s0) hashing. This allows releases before 1.0.0 to use these links along-side newer releases.
"-v" 4
Item "-v" Print messages about old links removed and new links created. By default, this command only lists each directory as it is processed.
"-provider name" 4
Item "-provider name"

0

"-provider-path path" 4
Item "-provider-path path"
"-propquery propq" 4
Item "-propquery propq"

See \*(L"Provider Options\*(R" in openssl\|(1), provider\|(7), and property\|(7).

"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" \fBopenssl\|(1), \fBopenssl-crl\|(1), \fBopenssl-x509\|(1)
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.