man-pages/man1/rehash.1ssl.html
2021-03-31 01:06:50 +01:00

205 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of REHASH</TITLE>
</HEAD><BODY>
<H1>REHASH</H1>
Section: OpenSSL (1SSL)<BR>Updated: 2021-03-22<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
openssl-c_rehash, openssl-rehash, c_rehash, rehash - Create symbolic links to files named by the hash values
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>openssl</B>
<B>rehash</B>
<B>[-h]</B>
<B>[-help]</B>
<B>[-old]</B>
<B>[-n]</B>
<B>[-v]</B>
[ <I>directory</I>...]
<P>
<B>c_rehash</B>
<I>flags...</I>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
On some platforms, the OpenSSL <B>rehash</B> command is available as
an external script called <B>c_rehash</B>. They are functionally equivalent,
except for minor differences noted below.
<P>
<B>rehash</B> scans directories and calculates a hash value of each
<TT>&quot;.pem&quot;</TT>, <TT>&quot;.crt&quot;</TT>, <TT>&quot;.cer&quot;</TT>, or <TT>&quot;.crl&quot;</TT>
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 utility is useful as many programs that use OpenSSL require
directories to be set up like this in order to find certificates.
<P>
If any directories are named on the command line, then those are
processed in turn. If not, then the <B></B><FONT SIZE="-1"><B>SSL_CERT_DIR</B></FONT><B></B> environment variable
is consulted; this should be a colon-separated list of directories,
like the Unix <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B> variable.
If that is not set then the default directory (installation-specific
but often <B>/usr/local/ssl/certs</B>) is processed.
<P>
In order for a directory to be processed, the user must have write
permissions on that directory, otherwise an error will be generated.
<P>
The links created are of the form <TT>&quot;HHHHHHHH.D&quot;</TT>, where each <B>H</B>
is a hexadecimal character and <B>D</B> is a single decimal digit.
When processing a directory, <B>rehash</B> will first remove all links
that have a name in that syntax, even if they are being used for some
other purpose.
To skip the removal step, use the <B>-n</B> flag.
Hashes for <FONT SIZE="-1">CRL</FONT>'s look similar except the letter <B>r</B> appears after
the period, like this: <TT>&quot;HHHHHHHH.rD&quot;</TT>.
<P>
Multiple objects may have the same hash; they will be indicated by
incrementing the <B>D</B> value. Duplicates are found by comparing the
full <FONT SIZE="-1">SHA-1</FONT> fingerprint. A warning will be displayed if a duplicate
is found.
<P>
A warning will also be displayed if there are files that
cannot be parsed as either a certificate or a <FONT SIZE="-1">CRL</FONT> or if
more than one such object appears in the file.
<A NAME="lbAE">&nbsp;</A>
<H3>Script Configuration</H3>
The <B>c_rehash</B> script
uses the <B>openssl</B> program to compute the hashes and
fingerprints. If not found in the user's <B></B><FONT SIZE="-1"><B>PATH</B></FONT><B></B>, then set the
<B></B><FONT SIZE="-1"><B>OPENSSL</B></FONT><B></B> environment variable to the full pathname.
Any program can be used, it will be invoked as follows for either
a certificate or <FONT SIZE="-1">CRL:</FONT>
<P>
<PRE>
$OPENSSL x509 -hash -fingerprint -noout -in FILENAME
$OPENSSL crl -hash -fingerprint -noout -in FILENAME
</PRE>
<P>
where <B></B><FONT SIZE="-1"><B>FILENAME</B></FONT><B></B> 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.
<A NAME="lbAF">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-help</B> <B>-h</B><DD>
Display a brief usage message.
<DT id="2"><B>-old</B><DD>
Use old-style hashing (<FONT SIZE="-1">MD5,</FONT> as opposed to <FONT SIZE="-1">SHA-1</FONT>) for generating
links to be used for releases before 1.0.0.
Note that current versions will not use the old style.
<DT id="3"><B>-n</B><DD>
Do not remove existing links.
This is needed when keeping new and old-style links in the same directory.
<DT id="4"><B>-compat</B><DD>
Generate links for both old-style (<FONT SIZE="-1">MD5</FONT>) and new-style (<FONT SIZE="-1">SHA1</FONT>) hashing.
This allows releases before 1.0.0 to use these links along-side newer
releases.
<DT id="5"><B>-v</B><DD>
Print messages about old links removed and new links created.
By default, <B>rehash</B> only lists each directory as it is processed.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="6"><B></B><FONT SIZE="-1"><B>OPENSSL</B></FONT><B></B><DD>
The path to an executable to use to generate hashes and
fingerprints (see above).
<DT id="7"><B></B><FONT SIZE="-1"><B>SSL_CERT_DIR</B></FONT><B></B><DD>
Colon separated list of directories to operate on.
Ignored if directories are listed on the command line.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+openssl">openssl</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+crl">crl</A></B>(1).
<B><A HREF="/cgi-bin/man/man2html?1+x509">x509</A></B>(1).
<A NAME="lbAI">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
<P>
Licensed under the OpenSSL license (the ``License''). You may not use
this file except in compliance with the License. You can obtain a copy
in the file <FONT SIZE="-1">LICENSE</FONT> in the source distribution or at
&lt;<A HREF="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</A>&gt;.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="8"><A HREF="#lbAB">NAME</A><DD>
<DT id="9"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="10"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DL>
<DT id="11"><A HREF="#lbAE">Script Configuration</A><DD>
</DL>
<DT id="12"><A HREF="#lbAF">OPTIONS</A><DD>
<DT id="13"><A HREF="#lbAG">ENVIRONMENT</A><DD>
<DT id="14"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="15"><A HREF="#lbAI">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:26 GMT, March 31, 2021
</BODY>
</HTML>