I believe the “law of the sea” is that pirates can be hanged without trial.
It was customary in many countries to hang them in port for all to see. London for one...
re: pirates can be hanged without trial
There are few ‘laws’ or understandings that are more widely known or as universally accepted as the defense of a ship at sea. The handling of horse thieves in the Wild West is similar, but the policy on pirates to back much longer!
After such an incident the ship should sail into its next stop with the severed heads of the pirates hanging from it railing.