The principle of sovereignty sometimes conflicts with international law. One reason the Law of the Sea Treaty has not been approved by the U.S. Senate is that some senators think it violates U.S. sovereignty. Similarly, countries such as China claim that enforcing international human rights laws in their countries would be a violation of their sovereignty. Some Muslim countries claim that international law on women’s rights violates their cultural sovereignty.
There is lots of international law on the subject of sovereignty. To be a state, one must possess territory, a population and a government that is in control. If a state meets these criteria, normally other states will accord it diplomatic recognition. However, sometimes they signal their disapproval by refusing to do so. For instance, the U.S. waited for decades before recognizing the communist regimes in the USSR and China. Similarly, Iran does not recognize Israel.
As a state, you have the rights of self-defense, independence (i.e. the freedom to make your own policies) and legal equality with other states. Of course, some powerful states are more ‘equal’ than others, just as a rich man usually does better in court than a poor one. Nevertheless, any state has the right to bring a case under international law against any other state, as tiny Nicaragua did against the U.S.
States also have duties: the flip side of sovereignty is non-intervention in the affairs of others (a principle which is sometimes violated), and obeying treaties that have been agreed to.
Because of the tension with sovereignty, international law is relatively weak. The laws are not binding, the legal decisions are not binding, and often the penalties are not enforceable. Some critics say there is a double standard - powerful countries flout international law, while they insist other countries obey it. Nevertheless, overall there is a remarkable degree of compliance. International law may be weak, but it is effective; because of reciprocity, most states follow most international law most of the time.