A public officer who, in the exercise of his official duty, puts a person to death pursuant to a sentence of a court of competent jurisdiction, is justified if he acts in accordance with the sentence pronounced and the law prescribing the procedure for execution of a death sentence.
720 ILCS 5/7-10