def generate_key_pair(self, encodeb64=False):
        keypair = {}
        pkey = paramiko.RSAKey.generate(1024)
        keypair["public_key"] = pkey.get_base64()
        s = StringIO()
        pkey.write_private_key(s)
        k = s.getvalue()
        s.close()

        if encodeb64:
            k = base64.b64encode(b(k))

        keypair["private_key"] = k

        return keypair