util.ssh: reorder return args

This commit is contained in:
Jimmy Zelinskie 2015-03-18 17:32:59 -04:00
parent c9d955e432
commit 288f847e9a

View file

@ -1,11 +1,10 @@
from Crypto.PublicKey import RSA
def generate_ssh_key():
def generate_ssh_keypair():
"""
Generates a new 2048 bit RSA private key in PEM format and public key in OpenSSH format.
Generates a new 2048 bit RSA public key in OpenSSH format and private key in PEM format.
"""
key = RSA.generate(2048)
private_pem = key.exportKey('PEM')
public_key = key.publicKey().exportKey('OpenSSH')
return (private_pem, public_key)
private_key = key.exportKey('PEM')
return (public_key, private_key)