Legitimacy arises structurally when power limits itself through recourse. [definitional]
If we accept an idea of Stinchcombe's, that such formatted possibilities of recourse to the power reserves of others show one's power to be legitimate, then we can see that the law as power-code creates legitimacy structurally (and without it being bound to particular values or even the convictions of the power-subject). Legitimacy is then no more than the formation of contingencies within the sphere of power.
DEFINE: Defines legitimacy as structural contingency formation within power, not as a value-bound moral property.
Niklas Luhmann, Trust and Power, loc. 674