{
    "mode": "man",
    "parameter": "OPENSSL-REHASH",
    "section": "1SSL",
    "url": "https://www.chedong.com/phpMan.php/man/OPENSSL-REHASH/1SSL/json",
    "generated": "2026-06-12T23:56:30Z",
    "synopsis": "openssl rehash [-h] [-help] [-old] [-compat] [-n] [-v] [-provider name] [-provider-path path]\n[-propquery propq] [directory] ...\ncrehash [-h] [-help] [-old] [-n] [-v] [-provider name] [-provider-path path] [-propquery\npropq] [directory] ...",
    "sections": {
        "NAME": {
            "content": "openssl-rehash, crehash - Create symbolic links to files named by the hash values\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "openssl rehash [-h] [-help] [-old] [-compat] [-n] [-v] [-provider name] [-provider-path path]\n[-propquery propq] [directory] ...\n\ncrehash [-h] [-help] [-old] [-n] [-v] [-provider name] [-provider-path path] [-propquery\npropq] [directory] ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This command is generally equivalent to the external script crehash, except for minor\ndifferences noted below.\n\nopenssl rehash scans directories and calculates a hash value of each .pem, .crt, .cer, or\n.crl file in the specified directory list and creates symbolic links for each file, where the\nname of the link is the hash value.  (If the platform does not support symbolic links, a copy\nis made.)  This command is useful as many programs that use OpenSSL require directories to be\nset up like this in order to find certificates.\n\nIf any directories are named on the command line, then those are processed in turn. If not,\nthen the SSLCERTDIR environment variable is consulted; this should be a colon-separated\nlist of directories, like the Unix PATH variable.  If that is not set then the default\ndirectory (installation-specific but often /usr/local/ssl/certs) is processed.\n\nIn order for a directory to be processed, the user must have write permissions on that\ndirectory, otherwise an error will be generated.\n\nThe links created are of the form HHHHHHHH.D, where each H is a hexadecimal character and D\nis a single decimal digit.  When a directory is processed, all links in it that have a name\nin that syntax are first removed, even if they are being used for some other purpose.  To\nskip the removal step, use the -n flag.  Hashes for CRL's look similar except the letter r\nappears after the period, like this: HHHHHHHH.rD.\n\nMultiple objects may have the same hash; they will be indicated by incrementing the D value.\nDuplicates are found by comparing the full SHA-1 fingerprint. A warning will be displayed if\na duplicate is found.\n\nA warning will also be displayed if there are files that cannot be parsed as either a\ncertificate or a CRL or if more than one such object appears in the file.\n",
            "subsections": [
                {
                    "name": "Script Configuration",
                    "content": "The crehash script uses the openssl program to compute the hashes and fingerprints. If not\nfound in the user's PATH, then set the OPENSSL environment variable to the full pathname.\nAny program can be used, it will be invoked as follows for either a certificate or CRL:\n\n$OPENSSL x509 -hash -fingerprint -noout -in FILENAME\n$OPENSSL crl -hash -fingerprint -noout -in FILENAME\n\nwhere FILENAME is the filename. It must output the hash of the file on the first line, and\nthe fingerprint on the second, optionally prefixed with some text and an equals sign.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-help -h",
                    "content": "Display a brief usage message.\n",
                    "flag": "-h"
                },
                {
                    "name": "-old",
                    "content": "Use old-style hashing (MD5, as opposed to SHA-1) for generating links to be used for\nreleases before 1.0.0.  Note that current versions will not use the old style.\n"
                },
                {
                    "name": "-n",
                    "content": "same directory.\n",
                    "flag": "-n"
                },
                {
                    "name": "-compat",
                    "content": "Generate links for both old-style (MD5) and new-style (SHA1) hashing.  This allows\nreleases before 1.0.0 to use these links along-side newer releases.\n"
                },
                {
                    "name": "-v",
                    "content": "only lists each directory as it is processed.\n",
                    "flag": "-v"
                },
                {
                    "name": "-provider",
                    "content": ""
                },
                {
                    "name": "-provider-path",
                    "content": ""
                },
                {
                    "name": "-propquery",
                    "content": "See \"Provider Options\" in openssl(1), provider(7), and property(7).\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "OPENSSL\nThe path to an executable to use to generate hashes and fingerprints (see above).\n\nSSLCERTDIR\nColon separated list of directories to operate on.  Ignored if directories are listed on\nthe command line.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "openssl(1), openssl-crl(1), openssl-x509(1)\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a copy in the file LICENSE in the source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n\n\n3.0.2                                        2026-06-02                         OPENSSL-REHASH(1SSL)",
            "subsections": []
        }
    },
    "summary": "openssl-rehash, crehash - Create symbolic links to files named by the hash values",
    "flags": [
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Display a brief usage message."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Use old-style hashing (MD5, as opposed to SHA-1) for generating links to be used for releases before 1.0.0. Note that current versions will not use the old style."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "same directory."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Generate links for both old-style (MD5) and new-style (SHA1) hashing. This allows releases before 1.0.0 to use these links along-side newer releases."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "only lists each directory as it is processed."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "See \"Provider Options\" in openssl(1), provider(7), and property(7)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "openssl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/openssl/1/json"
        },
        {
            "name": "openssl-crl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/openssl-crl/1/json"
        },
        {
            "name": "openssl-x509",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/openssl-x509/1/json"
        }
    ]
}