The Metaphysical Elements of Ethics by Immanuel Kant Chapter 8 Page 4

For it is not possible to man to see so far into the depth of his own heart that he could ever be thoroughly certain of the purity of his moral purpose and the sincerity of his mind even in one single action, although he has no doubt about the legality of it. Nay, often the weakness which deters a man from the risk of a crime is regarded by him as virtue (which gives the notion of strength). And how many there are who may have led a long blameless life, who are only fortunate in having escaped so many temptations. How much of the element of pure morality in their mental disposition may have belonged to each deed remains hidden even from themselves.

Accordingly, this duty to estimate the worth of one's actions not merely by their legality, but also by their morality (mental disposition), is only of indeterminate obligation;