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wmQg2TtDt8vWEgZRXcoA+Fs2UpN5B/SjJAJ1jUSuxxo9
7UoenxNd+10eofjHub0gZMsUJiYCF26zHCADhnvVAoGBANdwd/2oVyLkW7jXpVWi
6T2F/NXo+rwCT1pRDIaoCKyIg2wAvpRt62NTBenhhtV/tzVH79gwVC7ICS2iVN0y
dD5nWn0RHeFaeuGsAPMCiF5prveetifiNZgkXvQF9aZ5mHYY7zafmYcvB9GRoeam
g8PSex6q0UVQkkpb1DLvHpPFAoGAFWmaRq6yRoquCWdlEd3RXaR43OhGsGPW30wW
J7Q+zI94mspMaS3+DgqlsvYnjTRIVvg7fBMJKmW3hzt7tNWLfxxAP9J3BomexjGn
moaptBRR5rTlBzZjjt3fCi4G5dw3qSpmPtAYnc7RSllic/2L7k2YjQnoK6bDS67m
pTyu+Y0CgYEA4zlOFpOXxrf8bOtrUYLpeBBiMGk1YkfY+LxejunlVe3K+TS10FoE
YoWVh/PtuSCYScgdCqylVNUTBq1GRK7K9ZXpFrViefo+Md68pqiWqOCdDMi5GyY8
0LIC6HDwAbxQBV14IUvvUuUq9Dcq6qBLSP//zo7jK5raN3DBPRt6Hr4=
-----END RSA PRIVATE KEY-----
ssl 证书(省略)
因为我有时在 macos 钥匙串中知道站点的证书有到期时间。如果我只知道 ssl key 和 ssl cert 数据,是否可以获得到期时间?
密钥不会过期。证书可以。证书是二进制数据。没有工具,它们是不可读的。
根据证书的编码方式,您只需将其重命名为
.cer
并在 Windows 上打开即可。然后它将向您显示证书中的所有数据。使用 OpenSSL,您可以在命令行上检查证书:
OpenSSL 基本上适用于所有东西,但您可能必须先安装它。
你会得到这样的东西: