Linux上的Unix c_rehash命令/脚本相当于什么?

Woj*_*tek 4 ssl openssl ssl-certificate

我按照有关如何将整个链的证书导入密钥库的说明进行操作.我面临的问题是我的系统上没有c_rehash:

user@hostanme$ c_rehash ./certs
-bash: c_rehash: command not found
Run Code Online (Sandbox Code Playgroud)

我找到了openssl x509-subject_hash选项,但我不知道如何使用它来复制c_rehash所做的任何事情.

如何在没有c_rehash命令/脚本的情况下散列证书目录?

agf*_*fe2 7

c_rehash需要"perl"才能执行.如果您无法运行c_rehase,请尝试以下操作.

在Shell文件中使用"openssl"

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

  • 需要更多引号才是正确的 - 如果您的证书名称中有空格,这将无法正常工作.考虑`ln -s"$ file""$(openssl x509 -hash -noout -in"$ file")"`. (4认同)