方式一
# openssl x509 -noout -modulus -in server.crt | openssl md5
# openssl rsa -noout -modulus -in server.key | openssl md5
# (openssl x509 -noout -modulus -in server.crt | openssl md5; openssl rsa -noout -modulus -in server.key | openssl md5) | uniq
方式二
# openssl pkey -in server.key -pubout -outform pem | sha256sum
# openssl x509 -in server.crt -pubkey -noout -outform pem | sha256sum
参考
验证密钥与证书是否匹配
https://blog.csdn.net/tsh185/article/details/8233946
https://blog.csdn.net/cyberspecter/article/details/89478218
Certificate Key Matcher
https://www.sslshopper.com/certificate-key-matcher.html
网友评论