def METHOD_NAME(self, key: Key) -> bool:
    existing_key = self.get_key(key.user_id, key.device_id)
    if existing_key:
        if (
            existing_key.user_id == key.user_id
            and existing_key.device_id == key.device_id
            and type(existing_key) is type(key)
        ):
            if existing_key.key != key.key:
                message = (
                    f"Error: adding existing device to trust store with "
                    f"mismatching fingerprint {key.key} {existing_key.key}"
                )
                logger.error(message)
                raise OlmTrustError(message)
    self._entries.append(key)
    return True