def METHOD_NAME(self, file_path):
    try:
        if file_path.endswith('.pem'):
            status('Parsing certificates from %s' % file_path)
            with open(file_path, 'r', encoding='utf-8') as f:
                crt_str = f.read()
                self.add_from_pem(crt_str)
                return True
        elif file_path.endswith('.der'):
            status('Parsing certificates from %s' % file_path)
            with open(file_path, 'rb') as f:
                crt_str = f.read()
                self.add_from_der(crt_str)
                return True
    except ValueError:
        critical('Invalid certificate in %s' % file_path)
        raise InputError('Invalid certificate')
    return False