Openssl RSA操作

来源:互联网 发布:阿里云全球排名 编辑:程序博客网 时间:2024/06/05 06:22

生成key对:

openssl genrsa -aes128 -out pv.key 1024

上面使用aes-128保护key,执行命令后要求输入密码,在导入key的时候需要输入密码。若不需要密码保护,则确定密码保护选项:

openssl genrsa -out pv.key 1024

从私钥中提取公钥:

openssl rsa -in pv.key -pubout -out pb.key

从私钥中获取p q n e d信息:

openssl rsa -text -in pv.key

从公钥中获取n e信息:

openssl rsa -pubin -inform PEM -text -noout < pb.key


参考:

https://www.feistyduck.com/library/openssl-cookbook/online/ch-openssl.html


0 0
原创粉丝点击