As I begin a review of the Canons of Trent on Justification, it's worth pointing out that when we read them, the Decree must be kept in mind as a necessary context for understanding them. It won't do for us (or our adversaries) to rip a canon out of context in order to satisfy some pet theory other.
If any one saith, that man may be justified before God by his own works, whether done through the teaching of human nature, or that of the law, without the grace of God through Jesus Christ; let him be anathema. [Canon I]
It appears that two errors are condemned here: first, that man can be justified before God by virtue of his own works as informed by natural law ("done through the teaching of human nature"), and secondly that he can be justified by works of the law apart from the grace of God. There is no way that we can merit justification in and of ourselves by anything that we do. To the contrary, if indeed it can be said that we merit that, it's only by virtue of the righteousness of Christ which God infuses into us, as we saw in relation to §16 of the Decree on Justification. Hence we see that legalism is positively and explicitly condemned by Trent, so that the canards vented by various enemies of the Church are overturned. We are saved by grace, and no Catholic may rightly say otherwise.