openssl生成rsa公私钥

转载自https://blog.csdn.net/fableboy/article/details/39697691

PKCS #8 使用 ASN.1 的 DER 编码规则。

openssl.exe 可以用来生成 PEM 格式的 RSA 密钥对。

1、生成私钥pem,  执行命令 openssl genrsa -out rsa_private_key.pem 1024
2、生成公钥,执行命令openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
3、将RSA私钥转换成PKCS8格式,命令执行openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt PHP服务端语言读取私钥不需要PKCS8转换。

猜你喜欢

转载自blog.csdn.net/csdn9988680/article/details/79730812
今日推荐