如何从文件确定证书类型
OpenSSL 证书似乎没有任何标准命名约定,因此我想知道是否有一个简单的命令可以获取有关任何 OpenSSL 证书的重要信息,无论其类型如何。我想至少知道证书类型(x509、RSA、DSA)以及它是公钥还是私钥。查看我刚刚从 PKCS12 文件中提取的证书的内容,这些都没有明确显示。
There doesn't seem to be any sort of standard naming convention for OpenSSL certificates, so I'd like to know if there's a simple command to get important information about any OpenSSL certificate, regardless of type. I'd like to know at least the certificate type (x509, RSA, DSA) and whether it's a public or private key. Looking at the contents of a certificate I just extracted from a PKCS12 file, neither of these are explicitly shown.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您遇到一些术语问题:
因此,如果您正在检查 PKCS#12 文件(通常为 .p12 扩展名),那么您已经知道:
您所不知道的是这些证书和信息是否有效。私钥是 RSA 或 DSA。您可以通过提取证书来检查这一点,然后检查它们:
openssl x509
命令的文本输出应包含Subject Public Key
部分,其中包括可让您查看它是 RSA 还是 DSA 密钥(以及密钥大小)的字段。Firstly, you have a few terminology problems:
So, if you're examining a PKCS#12 file (typically .p12 extension), then you already know:
All you don't know is whether those certificate & private key are RSA or DSA. You can check this by extracting the certificate(s), and then examine them:
The text output of the
openssl x509
command should include aSubject Public Key
section, which will include fields that let you see if it's an RSA or DSA key (along with the key size).