What is the equivalent of the unix c_rehash / script command in Linux?

I am following the instructions on how to import the certificate with the entire chain into the keystore . The problem I'm running into is that I don't have c_rehash on my system:

user@hostanme$ c_rehash ./certs
-bash: c_rehash: command not found


I found - subject_hash variant of openssl x509 , but I'm not sure how to use it to replicate any c_rehash.

How can I hash the certificates directory without the c_rehash / script command?


source to share

2 answers

c_rehash requires "perl" to run. If you can't run c_rehase try below.

use "openssl" in your shell file

for file in *.pem; do ln -s "$file" "$(openssl x509 -hash -noout -in "$file")".0; done




user @hostanme $ c_rehash. / certs
- bash: c_rehash: command not found

You either need to install OpenSSL (developer version maybe), or you need to put its directory bin/

in the path:

$ find /usr -iname c_rehash


And make sure you are using the correct one. If I remember correctly, OpenSSL 0.9.8 uses MD5 and OpenSSL 1.0.0 and above uses SHA1.



All Articles