天天看点

使用openssl生成公钥与私钥

1.生成RSA私钥:

  genrsa -out demo.txt 1024                                                                                                                                    生成1024位的私钥 如下图:                                                                                      

使用openssl生成公钥与私钥

2.将私钥转换成PKCS8格式:                                                                                                                                      pkcs8 -topk8 -inform PEM -in demo.txt  -outform PEM –nocrypt                                                                           PKCS8格式的私钥如下图                                                                                                                                  

使用openssl生成公钥与私钥

3.生成RSA公钥:

继续阅读