A corsair is a Government sanctioned pirate. I guess Sir Francis Drake, he of the defeat of the Spanish Armada, would qualify. And others sanctioned by Elizabeth I, of whom I do not know the names.

Barbary corsairs were pirates from North Africa attacking ships flying the flags of countries of Northern Europe. French corsairs were pirates acting on behalf of the French crown. The word comes from the Latin currere meaning to run.

A privateer is a private ship, a private man of war, an armed vessel owned and officered by private persons, but usually acting under commission from the state.

And an xebec (pronounced zee-beck) is a small, three-masted vessel found in the Mediterranean, often used by corsairs, and now used in commerce. Wikipedia mentions that in the 1800s, xebecs overtook galleys as the preferred ships of Barbary pirates because they used wind power, which reduced need for slaves to row. And because they could carry more guns – presumably because the ship wasn’t cluttered up with slaves and oars – and had better manoeuvrability.