Legitimacy refers to something being within the law and socially accepted. The legitimacy of the new policy was recognized by the international community.
Pro Tip 2/2
Beyond Law
Sometimes 'legitimacy' includes moral or ethical acceptance, not just legal. Despite being legal, the project lacked legitimacy in the public's eyes.