linux - CRL 有效性 openssl
问题描述
我需要验证下载的 crl 实际上是 CA 生成的,并且没有被潜在的攻击者修改。有没有办法用来自 linux os 的 openssl 命令来验证这一点?
换句话说,我需要根据其根 CA 验证 CRL 签名,我已经找到了这个链接,但对我没有多大帮助。 针对其根 CA 验证 CRL 签名
解决方案
openssl 有一个命令来验证下载的 crl 对颁发证书颁发机构的签名。
openssl crl -verify -in <crl file> -CAfile < issue certificate or cert chain>
这是根据 Google 颁发者 CA 证书验证 GOOGLE CRL 的 hello-world 示例
使用 wget 下载谷歌 crl
wget http://crl.pki.goog/GTS1O1core.crl
下载的 CRL 是 DER 格式,转换成 PEM 格式
openssl crl -inform DER -in GTS1O1core.crl -outform PEM -out google_crl.pem
下载谷歌证书链
OLDIFS=$IFS; IFS=':' certificates=$(openssl s_client -connect google.com:443 -showcerts -tlsextdebug -tls1 2>&1 </dev/null | sed -n '/-----BEGIN/,/-----END/ {/-----BEGIN/ s/^/:/; p}'); for certificate in ${certificates#:}; do echo $certificate | tee -a google-cert-chain.pem ; done; IFS=$OLDIFS
根据颁发证书验证下载的 CRL(在 3 中下载的证书链中可用)
openssl crl -verify -in google_crl.pem -CAfile google-cert-chain.pem
推荐阅读
- c# - C# 软件中的“NetUseAdd”可在一台电脑上工作,但不能在另一台电脑上工作(错误 1232)
- c++ - rcpp:如何监控变量的内存使用情况?
- rust - 为什么 rust 'pub fn func(&'a mut self)' 在运行后被认为是“可变借用”?
- reactjs - 应用栏和状态栏之间的空间太大
- r - 在 html 文档中使用 Rmarkdown 绘图
- python - 如何将系列属性名称转换为具有相应属性值的标题
- elasticsearch - ElasticSearch 按数组中的值过滤
- python - Jupyter Notebook 中的逻辑回归;输入包含 NaN、无穷大或对于 dtype('float64') 来说太大的值
- javascript - 如何使用jQuery获取每个数据的总和?
- c# - 如何创建自定义 html 助手以将图标添加到输入剑道组合框