赞
踩
一、安装OpenSLL,选择默认路径C:\OpenSSL-Win64\bin
下载Win64OpenSSL.exe
二、配置环境变量
复制路径:C:\OpenSSL-Win64\bin
打开Path目录,添加该路径
三、在bin目录创建private文件夹(存储生成的公钥)
四、打开CMD
注:CN=(名字与
姓氏), OU=(组织单位名称), O=(组织名称), L=(城市或区域名称), ST=(州或省份名称), C=(单位的两字母国家代码)
Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd /
C:>cd C:\OpenSSL-Win64\bin
C:\OpenSSL-Win64\bin>openssl genrsa -out root.key 2048
Generating RSA private key, 2048 bit long modulus
….+++
………………………………+++
e is 65537 (0x010001)
C:\OpenSSL-Win64\bin>set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg
C:\OpenSSL-Win64\bin>echo %OPENSSL_CONF%
C:\OpenSSL-Win64\bin\openssl.cfg
C:\OpenSSL-Win64\bin>openssl req -new -key root.key -out root.csr -subj “/C=CN/ST=ShangHai/L=ShangHai/O=Yunan International Trust Company/OU=Internet Finance/CN=YNTRUST”
C:\OpenSSL-Win64\bin>openssl x509 -req -days 3000 -sha1 -extensions v3_ca -signkey root.key -in root.csr -out root.cer
Signature ok
subject=C = CN, ST = ShangHai, L = ShangHai, O = Yunan International Trust Company, OU = Internet Finance, CN = YNTRUST
Getting Private key
C:\OpenSSL-Win64\bin>openssl genrsa -out private/server-key.pem 2048
Generating RSA private key, 2048 bit long modulus
…………+++
…………………………………………+++
e is 65537 (0x010001)
C:\OpenSSL-Win64\bin>openssl req -new -key private/server-key.pem -out private/server.csr -subj “/C=CN/ST=ShangHai/L=ShangHai/O=Yunan International Trust Company/OU=Internet Finance/CN=YNTRUST”
C:\OpenSSL-Win64\bin>openssl x509 -req -days 3000 -sha1 -extensions v3_req -CA root.cer -CAkey root.key -CAserial ca.srl -CAcreateserial -in private/server.csr -out private/server.cer
Signature ok
subject=C = CN, ST = ShangHai, L = ShangHai, O = Yunan International Trust Company, OU = Internet Finance, CN = YNTRUST
Getting CA Private Key
C:\OpenSSL-Win64\bin>openssl x509 -outform der -in private/server.cer -out private/publicserver.ccertificate.der
C:\OpenSSL-Win64\bin>openssl pkcs12 -export -in private/server.cer -inkey private/server-key.pem -out server.pfx
Enter Export Password:
Verifying - Enter Export Password:
C:\OpenSSL-Win64\bin>openssl rsa -in private/server-key.pem -pubout -outform PEM -out private/server-key-pub.pem
writing RSA key
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。