Refactor the util directory to use subpackages.
This commit is contained in:
parent
974ccaa2e7
commit
18100be481
46 changed files with 36 additions and 39 deletions
10
util/security/ssh.py
Normal file
10
util/security/ssh.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
from Crypto.PublicKey import RSA
|
||||
|
||||
def generate_ssh_keypair():
|
||||
"""
|
||||
Generates a new 2048 bit RSA public key in OpenSSH format and private key in PEM format.
|
||||
"""
|
||||
key = RSA.generate(2048)
|
||||
public_key = key.publickey().exportKey('OpenSSH')
|
||||
private_key = key.exportKey('PEM')
|
||||
return (public_key, private_key)
|
Reference in a new issue