A public official who cannot in good conscience enforce a law he or she thinks is morally corrupt has a duty to either resign or enforce the law, Justice Anthony Kennedy told a group of Harvard Law School students recently.

A student, indirectly referring to recent opposition to the court’s same sex marriage ruling by Kentucky county clerk Kim Davis as well as opposition to legal abortion, asked Kennedy the “duty” question during an Oct. 22 conversation with Harvard Law Dean Martha Minow.