From COMPENDIUM OF THE SOCIAL DOCTRINE OF THE CHURCH
The Church sees as a sign of hope a growing public opposition to the death penalty, even when such a penalty is seen as a kind of legitimate defence' on the part of society. Modern society in fact has the means of effectively suppressing crime by rendering criminals harmless without definitively denying them the chance to reform.[833] Whereas, presuming the full ascertainment of the identity and responsibility of the guilty party, the traditional teaching of the Church does not exclude the death penalty when this is the only practicable way to defend the lives of human beings effectively against the aggressor.[834] Bloodless methods of deterrence and punishment are preferred as they better correspond to the concrete conditions of the common good and are more in conformity to the dignity of the human person.[835] The growing number of countries adopting provisions to abolish the death penalty or suspend its application is also proof of the fact that cases in which it is absolutely necessary to execute the offender are very rare, if not practically non-existent.[836] The growing aversion of public opinion towards the death penalty and the various provisions aimed at abolishing it or suspending its application constitute visible manifestations of a heightened moral awareness.
Edit to fix the link