Yes an office means a duty. An officer is one who performs the duty. One who keeps the peace does so not only for others, but also for himself. The office of keeping the peace manifests upon all who enjoy the peace. Rather it is the fruit of the office which is peace that is enjoyed.
Exo_1:16 And he said, When ye do the office of a midwife to the Hebrew women, and see them upon the stools; if it be a son, then ye shall kill him: but if it be a daughter, then she shall live.
This verse speaks to the internal war between Carnality and Spirit Mind.
But I digress, the "office" is a duty and the officer is "midwife". The duty or obligation of office is imposed by a "higher power" which governs the realm. If you seek an external truth think Governor or King, if you seek an internal truth think Carnal Mind vs. Spirit Mind.