How to load a public RSA key into Python-RSA from a file?

前端 未结 5 1044
南笙
南笙 2020-12-31 10:08

I generated a private and a public key using OpenSSL with the following commands:

openssl genrsa -out private_key.pem 512
openssl rsa -in private_key.pem -pu         


        
5条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 10:32

    You can generate private key by ssh-keygen:

    ssh-keygen -t rsa
    

    and generate public key like this:

    ssh-keygen -e -m pem -f xxx > pubkey.pem
    

    http://blog.oddbit.com/2011/05/08/converting-openssh-public-keys/

提交回复
热议问题