If you are being attacked, you have the right to defend yourself, even if the attacker is a police officer. Despite this, it is illegal to resist arrest, and police are permitted to use force against recalcitrant offenders.