I have no formal education on the topic, but I hope I can provide an adequate answer.
St. Augustine famously said "lex iniusta non est lex," or, "an unjust law is no law at all." But, that still begs the question, What is an unjust law? According to Aquinas, an unjust law is any human law that isn't rooted in or contradicts natural law or divine law (Eternal law). Human law is any positive law made by man and possesses dual potentiality for legality and illegality. Illegal human laws are synonymous with unjust laws. However, all unjust laws don't have to be human laws.
Unjust laws, however, must be opposed openly, and the punishment for the said law must be accepted graciously.