I am following the instructions on how to import a certificate with its whole chain into a keystore. The problem I face is that I do not have c_rehash on my system:
user@hostanme$ c_rehash ./certs
-bash: c_rehash: command not found
I have found the -subject_hash option of openssl x509, but I am not sure how to use it to replicate whatever c_rehash does.
How can I hash the certificate directory without the c_rehash command/script?
The c_rehash script uses the openssl program to compute the hashes and fingerprints. If not found in the user's PATH, then set the OPENSSL environment variable to the full pathname.
openssl rehash scans directories and calculates a hash value of each . pem, . crt, .
DESCRIPTION. c_rehash scans directories and calculates a hash value of each ". pem" file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value.
c_rehash needs "perl" for execution. If you can not run c_rehase, try below.
use "openssl" in the Shell file
for file in *.pem; do ln -s "$file" "$(openssl x509 -hash -noout -in "$file")".0; done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With