Precisely.
If there are cases where capital punishment is necessary then, by definition, it cannot be inherently violative of human dignity.
Something that is morally necessary cannot be inherently immoral.
Sure, but in the Church's own words, these conditions are, for all intent and purpose, non-existent. We're not talking about executing people in self-defense, for example, in a battlefield environment or one of civil anarchy, where the rule of law has disappeared and/or authorities cannot protect citizens at large. It's morally acceptable to protect oneself and to protect society, however, there is no room for the self-defense of society argument where the criminal can remain in prison for the rest of his life. Where the dignity of the innocent individual is not endangered, there is no justification to execute the criminal, whose dignity is inviolable by the mere fact that he is made in the image of God.