'Given a path to a private key file, load the appropriate keyfile.
Tries to load the file as both an RSAKey and a DSAKey. If the file
cannot be loaded as either type, returns None.'

@staticmethod
def _load_key(path):

    try:
        return paramiko.DSSKey.from_private_key_file(path)
    except paramiko.SSHException:
        try:
            return paramiko.RSAKey.from_private_key_file(path)
        except paramiko.SSHException:
            return None
