博客文章 首页 > 博客文章列表 >

通过PHPStudy集成环境 中的OpenSSL工具生成公钥及私钥步骤(Windows)

通过PHPStudy集成环境 中的OpenSSL工具生成公钥及私钥

1、运行 cmd

2、进入 OpenSSL工具目录,PHPStudy集成环境 中的OpenSSL工具在Apache目录中的bin文件夹中;例如 OpenSSL工具在H:\phpStudy\Apache\bin

C:\Users\Administrator>H: 

H:\> cd phpStudy\Apache\bin  

H:\phpStudy\Apache\bin>

3、设置变量值, PHPStudy集成环境 中的Apache目录下conf文件夹中有openssl.cnf文件,该文件为设定OpenSSL工具的默认值,设置“OPENSSL_CONF=H:\phpStudy\Apache\conf\openssl.cnf”

H:\phpStudy\Apache\bin>set "OPENSSL_CONF=H:\phpStudy\Apache\conf\openssl.cnf"; 

4、通过OpenSSL工具生成私钥

H:\phpStudy\Apache\bin>openssl genrsa -out rsa_private_key.pem 1024

该命令会生成1024位的私钥

5、根据生成的私钥生成公钥

H:\phpStudy\Apache\bin>openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem

生成成功的界面如下:

Image

Imagehttps://blog-jc67-cn.oss-cn-beijing.aliyuncs.com/Images/2019-04-29/6pe45bE6fA.jpg 选择文件 开始上传

如遇页面排版混乱,请访问原网页   访问原网页