twisted.conch

Extract Publickey from Privatekey input using Python

自古美人都是妖i 提交于 2019-12-11 05:58:51
问题 I need to generate publickey from a private key without temporary location locally like we do in sshgen.So i use this.Here iam passing my private key as input like this(while executing): python codekey.py "-----BEGIN RSA PRIVATE KEY-----\nMIhhhhhhhhhhhhhhhh......Bidqt/YS3/0giWrtv+rMkJtv8n\nmirJ+16SZodI5gMuknvZG....................n-----END RSA PRIVATE KEY-----" My code (codekey.py): import sys import io from twisted.conch.ssh import keys k = sys.argv[1] rsa = keys.RSA.importKey(k) key = keys

What is the correct way to close a Twisted conch SSH connection?

送分小仙女□ 提交于 2019-12-10 14:52:26
问题 What is the correct way to close a Twisted conch SSH connection? Is there an explicit way to do this? All of the Twisted conch examples I have seen close the SSH channel then stop the reactor. The reactor shutdown seems to handle closing the connection. However, I'm using the wxreactor with wxPython and I do not want to stop the reactor, but I want to close the ssh connection when I'm finished with it. After looking at t.c.s.connection it seemed like the serviceStopped() method was the way to