util.ssh: reorder return args
This commit is contained in:
parent
c9d955e432
commit
288f847e9a
1 changed files with 4 additions and 5 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue