def generate_key_pair(bits=2048):
    key = generate_key(bits)
    keyout = six.StringIO()
    key.write_private_key(keyout)
    private_key = keyout.getvalue()
    public_key = '%s %s Generated-by-Nova' % (key.get_name(), key.get_base64())
    fingerprint = generate_fingerprint(public_key)
    return (private_key, public_key, fingerprint)
dataset/ETHPy150Open openstack/nova/nova/crypto.py/generate_key_pair/original