Very bad idea. Keep them out of reach of the ACLU lawyers. Military commission on the deck of the USS >fill in the name of vessel here<, and then hang 'em from the yardarm. Best part, it's legal.
Send a message. Hang them all and televise it.
It is indeed (almost) legal. Under the Consittution of the United States, our Congress has the power, "To define and punish piracies and felonies committed on the high seas, and offenses against the law of nations. The United States Congress did pass such a statute TITLE 18 > PART I > CHAPTER 81 > § 1651 (current as of Feb 1, 2010): "Whoever, on the high seas, commits the crime of piracy as defined by the law of nations, and is afterwards brought into or found in the United States, shall be imprisoned for life."
I'd rather see Congress expand that power to allow the use of the full force of our military power in cases of piracy and to allow military courts martial with execution at sea for pirates caught in the act. At least we do have the authority to send them to prison for life. The president (or for the next two years, the usurper) has the authority to set rules of engagement, and I'd like to see those rules include deadly force with no attempt at taking prisoners for all vessels engaged in piracy.