Torture is a war crime only when its committed by the parties to a conflict during a war. However torture can occur in many situations that are outside of that context. That's one reason why the United Nations Convention against Torture was created. Signatories to the Convention (Canada is one) are required to have prohibitions on torture in their criminal law.