php openssl.cnf 配置,php 使用apache中的openssl 生成RSA的秘钥

首先cmd 使用管理员打开 找到apache的bin目录 如 E:\phpstudy\PHPTutorial\Apache\bin

E:\phpstudy\PHPTutorial\Apache\bin>openssl genrsa -out rsa_private_key.pem 1024

WARNING: can't open config file: /apache24/conf/openssl.cnf

Generating RSA private key, 1024 bit long modulus

.........++++++

......................................................................++++++

e is 65537 (0x10001)

上面执行命令 出错  需要设置一下配置文件的路径  set OPENSSL_CONF=E:\phpstudy\PHPTutorial\Apache\conf\openssl.cnf

E:\phpstudy\PHPTutorial\Apache\bin>set OPENSSL_CONF=E:\phpstudy\PHPTutorial\Apache\conf\openssl.cnf

E:\phpstudy\PHPTutorial\Apache\bin>openssl genrsa -out rsa_private_key.pem 1024

Generating RSA private key, 1024 bit long modulus

.........................++++++

...................++++++

e is 65537 (0x10001)

就这样生成了私钥

下面生成公钥

E:\phpstudy\PHPTutorial\Apache\bin>openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt

-----BEGIN PRIVATE KEY-----

MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMcOTJ/xzAEa4J0u

gC2NFbHVSoQku1TXfL4NgGS1JFZ4l7hQOdc7hlDmJLOKV/ylL2jTz/Ew+6WZZYmD

/tva7TAfXfA17d7aLGvd+JeI7zE5gI9eFMK+KKJsnqyt5+NsgmW+Phjfqclb0gZs

IN4oX//mJjP1Q3/wIQkCElopibytAgMBAAECgYABV61Yns7bawz8wmWG6R6uVlvs

TDsfNVzYA0tMYpReKO4NBi19sB8VyJeSxmoVgB+zu0n5vHTWBxTSOpura+yRlXeQ

pKSQcN1fqpY7cFRAhLrmyFgtDGuoOrAccQYmPlD/z5AO+0h5lpKbHBrgkJ/5T29+

Fo5Mn0+Rolr6koJ4wQJBAPAxUXkmHijA9g4h0d4vBTZ92jYm46/zpm3dHjFTJJoO

rdlqYLjqddMtrBH7aIAqPKNyfn5kb85YnXpeLEbM8HUCQQDUJ+w6V+viLcJJhtRm

lfrKlhpe+c5+KQY4ej3mzxaWp8V4BA5Ai9p01ljIMvjXZCKWzE9/6fbfpR8fGGuT

XRRZAkBctpy9R8JidsFDiThqK/o2I3QkbPR8SW9Xfv+ViINbWAkxIAe/uPjMEBgY

RNP8jNElQh+jh/9ERh5bSpiKp7a1AkAepyoFgACP7Gae8wErVU4oCSoEQPmp1smU

TW02NQOhftoULhnVD5/fs7yeKGc1z70Dpr9xzt8hjx0BBCk+4Hr5AkEAjqrQsUYE

R29nWx1kWeva+q7+6dPhlD45oX3r141J0FbwERp+CEDIAy9MwE4SS1OJ/qharjgX

xGwCuQkABh0zag==

-----END PRIVATE KEY-----

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值