如何验证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

比较两者输出结果

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

相关推荐
Lsetea5 小时前
curl指定CA目录仍报证书不受信任:--capath与OpenSSL rehash排查
运维·https·ssl·openssl·curl
夜听莺儿鸣5 小时前
502-002_Linux驱动开发模块化编程
linux·驱动开发·模块化编程
wuminyu6 小时前
C++协程实现接收端的零拷贝Buffer管理原理剖析
java·linux·c语言·jvm·c++
科力锐品牌君7 小时前
应用级灾备 | 海量非结构化数据如何实现高效数据保护
linux·运维·网络·安全·系统安全·数据安全·灾备
zhangrelay7 小时前
ROS项目设计案例智能大模型正经乱答案例
linux·笔记·学习·ubuntu·机器人
流浪0018 小时前
Linux系统篇39——线程(四) pthread库的由来和线程的创建与等待
linux·操作系统·线程·pthread库
Lancker8 小时前
chnroute-linux — 中国大陆 IP 段每日自动更新 + 「仅允许国内访问」落地
linux·运维·tcp/ip
辻弋2018 小时前
【无标题】
大数据·服务器·前端·搜索引擎·开源软件
高山有多高8 小时前
【Linux笔记】Linux进程与守护进程
linux
大侠归来9 小时前
Ubuntu 搭建 APUE 环境:从源码编译到第一个示例跑通
linux·运维·ubuntu