如何确定我的证书是否包含私钥? [英] How do I identify if my certificate contains private key?

查看:945
本文介绍了如何确定我的证书是否包含私钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此服务器故障问题的答案几乎所有证书文件格式都可以同时包含私钥和公钥,因此,如何确定证书是否包含私钥?

According to the answer to this server-fault question almost all certificate file formats can contain private key alongside public key, as such how can I identify whether a certificate contains private key?

这很重要,因为我不想在不知不觉中将私钥发送到远程客户端。

This is important because I do not want to unknowingly send the private key to the remote client.

推荐答案

按照链接的结构:


  • .csr 。仅 pem der 格式

.pem 。密钥和/或证书。查找 ----- BEGIN私钥---- ----- BEGIN RSA私钥----- -----开始加密的私钥-----

.pem. keys and/or certificates. Look for -----BEGIN PRIVATE KEY---- or -----BEGIN RSA PRIVATE KEY----- or -----BEGIN ENCRYPTED PRIVATE KEY-----

.key 键,格式为 pem

.pkcs12 .pfx .p12 密钥和/或证书。列出带有 openssl pkcs12 -info -nocerts -in keystore.p12

.pkcs12 .pfx .p12 keys and/or certificates. List keys with openssl pkcs12 -info -nocerts -in keystore.p12

.jks的密钥键和/或证书。特定于Java的格式。

.jks keys and/or certificates. Java specific format.

.der pem 内容,无base64编码。在 openssl x509 -inform DER -in cert.der

.der pem content without base64 encoding. Look for KEY in openssl x509 -inform DER -in cert.der

.cert .cer .crt 密钥和/或证书。内容可以是 pem der

.cert .cer .crt keys and/or certificates. Content can be pem or der

.p7b 。仅证书

.crl 。没有键

这篇关于如何确定我的证书是否包含私钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆