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

比较两者输出结果

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

相关推荐
恒5394 小时前
Linux文件系统I
linux·运维·服务器
阿成学长_Cain4 小时前
Linux ipcs 命令超全详解:查看共享内存 / 消息队列 / 信号量,IPC 运维必备
linux·运维·服务器·网络·数据库
黯然神伤8884 小时前
AlmaLinux设置软件下载源
linux·alma
青瓦梦滋5 小时前
协议定制/序列化-反序列化(Linux视角)
linux·服务器·网络·c++
阿成学长_Cain8 小时前
Linux dirs命令详解|Bash目录堆栈管理快速切换目录实战教程
linux·运维·前端·数据库
ICECREAM9 小时前
Linux 进程间通讯(IPC)——总结
linux
想你依然心痛10 小时前
嵌入式Linux安全加固:SELinux、Capabilities与Seccomp——强制访问控制与沙箱
linux·运维·安全
MDM.Plus11 小时前
苹果MDM技术演进:从远程控制到设备信任体系的构建
运维·服务器·安全·ios·mdm·手机店
REDcker11 小时前
macOS 挂载 Linux 远程目录详解
linux·运维·macos