I answer that, Laws framed by man are either just or unjust. If they be just, they have the power of binding in conscience, from the eternal law whence they are derived, according to Prov. 8:15: "By Me kings reign, and lawgivers decree just things." Now laws are said to be just, both from the end, when, to wit, they are ordained to the common good---and from their author, that is to say, when the law that is made does not exceed the power of the lawgiver---and from their form, when, to wit, burdens are laid on the subjects, according to an equality of proportion and with a view to the common good. For, since one man is a part of the community, each man in all that he is and has, belongs to the community; just as a part, in all that it is, belongs to the whole; wherefore nature inflicts a loss on the part, in order to save the whole: so that on this account, such laws as these, which impose proportionate burdens, are just and binding in conscience, and are legal laws.
On the other hand laws may be unjust in two ways: first, by being contrary to human good, through being opposed to the things mentioned above---either in respect of the end, as when an authority imposes on his subjects burdensome laws, conducive, not to the common good, but rather to his own cupidity or vainglory---or in respect of the author, as when a man makes a law that goes beyond the power committed to him---or in respect of the form, as when burdens are imposed unequally on the community, although with a view to the common good. The like are acts of violence rather than laws; because, as Augustine says (De Lib. Arb. i, 5), "a law that is not just, seems to be no law at all." Wherefore such laws do not bind in conscience, except perhaps in order to avoid scandal or disturbance, for which cause a man should even yield his right, according to Mt. 5:40,41: "If a man . . . take away thy coat, let go thy cloak also unto him; and whosoever will force thee one mile, go with him other two."
Secondly, laws may be unjust through being opposed to the Divine good: such are the laws of tyrants inducing to idolatry, or to anything else contrary to the Divine law: and laws of this kind must nowise be observed, because, as stated in Acts 5:29, "we ought to obey God rather than man."