

def load_key_file(path):
    '\n    Load a private key from a specified path.\n\n    :param FilePath path: Absolute path to certificate file.\n\n    :return: A ``ComparableKeyPair`` instance representing the parsed\n        key data.\n    '
    try:
        key_file = path.open()
    except IOError as e:
        (code, failure) = e
        raise PathError(b'Private key file could not be opened.', e.filename, code, failure)
    keypair = ComparableKeyPair(keypair=KeyPair.load(key_file.read(), format=crypto.FILETYPE_PEM))
    return keypair

dataset/ETHPy150Open ClusterHQ/flocker/flocker/ca/_ca.py load_key_file/original