赞
踩
操作步骤:
1、打开终端,然后输入命令:openssl
2、生成私钥:genrsa -out rsa_private_key.pem 2048
3、私钥转换成PKCS8格式:pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt -out rsa_private_key_pkcs8.pem
4、生成公钥:rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
5、退出,生成的文件在当前目录:exit
如下操作内容
OpenSSL> genrsa -out rsa_private_key.pem 2048
Generating RSA private key, 2048 bit long modulus
..............................+++
.......................................+++
e is 65537 (0x10001)
OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt -out rsa_private_key_pkcs8.pem
OpenSSL> rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
writing RSA key
OpenSSL> exit
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。