en English
X

Select Language

Powered by Google TranslateTranslate

We hope you will find the Google translation service helpful, but we don’t promise that Google’s translation will be accurate or complete. You should not rely on Google’s translation. English is the official language of our site.

en English
X

Select Language

Powered by Google TranslateTranslate

We hope you will find the Google translation service helpful, but we don’t promise that Google’s translation will be accurate or complete. You should not rely on Google’s translation. English is the official language of our site.

证明拥有私钥

您可以使用 OpenSSL的 通过用测试文件签名来显示私钥的所有权证明(POP)。 此方法适用于RSA和ECC密钥。

什么是OpenSSL?
OpenSSL是一个非常有用的开源命令行工具包,可用于 X.509 证书,证书签名请求(CSRs)和加密密钥。 如果使用的是Linux或macOS之类的UNIX变体,则您的计算机上可能已经安装了OpenSSL。 如果您想在Windows上使用OpenSSL,则可以启用 Windows 10的Linux子系统 或安装 Cygwin的.

使用私钥创建签名

  1. 创建一个测试文件:

    回声ssl.com> test.txt
  2. 使用私钥对测试文件的sha256哈希进行签名(替换 privatekey.pem 在下面的命令中输入密钥的实际文件名):

    openssl dgst -sha256 -sign privatekey.pem -out test.sig test.txt
  3. 现在,您可以通过发送来证明拥有私钥 test.sigtest.txt 给验证第三方,例如SSL.com。 您还可以按照以下步骤检查私钥是否与证书匹配:

确认私钥与证书匹配

  1. 从证书中提取公钥(替换 certificate.pem 在下面的命令中加上证书的实际文件名):

    openssl x509 -pubkey -noout -in certificate.pem> publickey.pem
  2. 使用公共密钥验证测试文件的sha256哈希:

    openssl dgst -sha256-验证publickey.pem -signature test.sig test.txt
  3. 如果私钥与证书匹配,您将获得输出 Verified OK。 如果没有,您会得到一个 Verification Failure.
感谢您选择SSL.com! 如有任何疑问,请通过电子邮件与我们联系 Support@SSL.com,致电 1-877-SSL-SECURE,或只需单击此页面右下方的聊天链接。 您还可以在我们的网站上找到许多常见支持问题的答案 知识库.

订阅 SSL.com 的时事通讯

不要错过SSL.com上的新文章和更新