ssl - 带有自己的 rsa 公钥信息的 openssl X509 证书

标签 ssl openssl rsa public-key-encryption

我是使用 Openssl 生成 x509 证书的初学者。

我想用我自己的 RSA 公钥创建一个 X509 证书,即自己的模数和公共(public)指数。我可以这样做吗?如果是,流程是怎样的?

最佳答案

If yes, what is the procedure to that?

它有很多东西。我的例程跨越 3 个源文件,所以我知道我不能轻易复制/粘贴某些东西。答案可能过于宽泛。

作为起点,您应该从这个 OpenSSL 命令开始生成自签名证书:

openssl req -config example-com.conf -new -x509 -sha256 \
    -newkey rsa:2048 -nodes -keyout example-com.key.pem \
    -days 365 -out example-com.cert.pem

该 OpenSSL 命令创建了一个新的自签名证书。如果省略 -x509选项,然后生成证书签名请求 (CSR)。

大多数选项都是不言自明的,-nodes意思是“私钥上没有密码”。另一个未知数是 -config example-com.conf , 你可以在 https://stackoverflow.com/a/26029695/608639 找到它.

鉴于您知道命令和选项,您应该研究 <openssl src>/apps/req.c 中的源代码.它是 openssl req ... 的源代码命令。需要源码的可以到OpenSSL: Source, Tarballs下载.

关于ssl - 带有自己的 rsa 公钥信息的 openssl X509 证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26029597/

相关文章:

ssl - 如何找到通过 Marklogic 证书模板生成的 SSL 证书的私钥?

security - 是否有可能在知道公钥和 "original data=>encrypted data"条目集的情况下获取 RSA 私钥?

c++ - 将 PCCERT_CONTEXT 转换为 openssl 使用 - X509 结构或 ASN1

c++ - 在 C++ 中加密并在 Python 中解密

ruby-on-rails - CSR 失败 : Error Parsing Request ASN1 bad tag value met (ASN: 267 CRYPT_E_ASN1_BADTAG)

java - Tomcat 中的 SSL 支持 : Redirect Issue

JAVA - 使用 keystore 对 AWS Elastic Beanstalk 中的 Web 服务进行 SSL 调用

ssl - 如何在 Ubuntu 18.04 上使用 SSL 安装 NGINX + Varnish 6.1.0???

ssl - Heroku ssl 证书 : Key could not be read since it's protected by a passphrase

java - 如何编写包含签名的 .RSA 文件(使用 Java)