Extract Publickey from Privatekey input using Python
问题 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