legally

In a way that follows the law and official rules.