Ger*_*ton 11
是的,您可以使用openssl检查证书(适用于Windows和*nix).
openssl x509 -in certificate.crt -text -noout
Run Code Online (Sandbox Code Playgroud)
更新
更准确地说,您可以分别比较密钥和证书的模数和公共指数,以保证证书与密钥匹配并且证书未被破坏.
openssl rsa -noout -modulus -in server.key.pem | openssl sha1;\
openssl x509 -noout -modulus -in server.crt | openssl sha1
Run Code Online (Sandbox Code Playgroud)
有效输出看起来像
7298b69426656f7a8ab3ef9686bc0a79588850e7
7298b69426656f7a8ab3ef9686bc0a79588850e7
Run Code Online (Sandbox Code Playgroud)
在手动修改证书后,输出将是.
7298b69426656f7a8ab3ef9686bc0a79588850e7
bd439a18d2d3689470e209dbd45b85a41db7230c
Run Code Online (Sandbox Code Playgroud)
命令
openssl x509 -in certificate.crt -text -noout
Run Code Online (Sandbox Code Playgroud)
用于验证证书链但不检查损坏.手动修改的证书可以返回有效的输出,但RSA Public Key: (4096 bit) Modulus (4096 bit):只有通过上述检查才能检测到该部件的问题.
| 归档时间: |
|
| 查看次数: |
8984 次 |
| 最近记录: |