How do use paramiko.RSAKey.from_private_key()?

前端 未结 5 1057
逝去的感伤
逝去的感伤 2021-01-01 23:37

Any idea how I can use the paramiko.RSAKey.from_private_key() function?

I know there is a from_private_key_file(), but I\'m interested in us

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-02 00:28

    This should do it:

    import io
    import paramiko
    
    private_key_file = io.StringIO()
    private_key_file.write('-----BEGIN RSA PRIVATE KEY-----\nlskjdflk\n...\n-----END RSA PRIVATE KEY-----\n')
    private_key_file.seek(0)
    private_key = paramiko.RSAKey.from_private_key(private_key_file)
    

提交回复
热议问题