如何验证ssl私钥和证书是否匹配?

从证书(CRT)文件提取公钥

bash 复制代码
openssl x509 -in server.crt -pubkey -noout | openssl sha256

从证书签名请求(CSR)文件提取公钥

bash 复制代码
openssl req -in server.csr -pubkey -noout | openssl sha256

从私钥(KEY)文件提取公钥

bash 复制代码
openssl pkey -in server.key -pubout | openssl sha256

比较两者输出结果

如果输出值相同,则它们匹配;如果不同,则表示不匹配。

相关推荐
xuhe21 分钟前
一劳永逸!解决 AutoDL 系统盘(30GB)爆满与 pip 缓存迁移
linux·python·ai·jupyter
学无止境_永不停歇36 分钟前
9. 缓冲区
linux·服务器·c++
dok1240 分钟前
Johannes 《Linux内核模块与设备驱动开发:编写Linux驱动程序》(4) devicefile 设备号相关
linux·运维·服务器
毛驴赶鹿1 小时前
低配置服务器怎么搭建监控?Komari Docker部署与公网访问完整教程
运维·服务器·docker
Fu2067211 小时前
结课项目考试
linux·运维·服务器
Albert·Lin2 小时前
LVS相关知识点总结-一
linux·服务器·lvs
公众号:fuwuqiBMC3 小时前
(转自“服务器BMC”)服务器BMC芯片——AST1840
运维·服务器·fpga开发
测试专家3 小时前
PCI-1553B板卡在 Windows Server 2016 服务器安装流程详解
服务器·windows·单片机
忘路之远近i3 小时前
受够阿里云自带终端后,我用 Cursor + grill-me 做了个运维面板
服务器·开发语言·人工智能·python·阿里云·云计算
laboratory agent开发3 小时前
工具调用失败后怎么办?重试分层与降级回路的三种路线
服务器·前端·网络