I have no idea while people think it's illegal to carry a pistol or any gun on a kayak or boat. It's completely legal once your on the water, just don't go into Mexican waters carrying one.
The big issue though is at the launch. While your on land you should not have the weapon on you or even loaded. If you want to carry a handgun put it in a drybag unloaded with the ammo stored in another bag.
I've occasionally taken a Model 642 38 S&W with me fishing.

Don't forget to clean and oil it.
As to shooting sharks the last thing I'd ever want to shoot is a protected species like a Great White. That said if I was on the water and a Great White was actively attacking my Kayak and I had a 38 with me I'd shoot it in a heartbeat. As many times as I could right in the head.
Also as far as the effects of guns on sharks goes... Well I used to fish sharks all the time and we used to shoot our Makos and threshers with a 22 long rifle in the head. Maybe it didn't kill them but it would stun them to the point they couldn't do anything,
For instance this Adult T fought for over and hour and drug us five miles but once we gaffed her with the fly gaff she took off so hard she almost ripped the cleat right off the boat. We shot her with the 22 maybe four times in the head and after that we had no problem pulling her back to the boat, tying her along side and cutting her gills and spinal cord.
I'm not saying that anyone should carry a gun or that it's necessary but it is legal, and though I think the risk of white attack is minimal, just logistically from my experience shooting a shark definitely does have an effect on it and if you hit in the brain stem or cord it would incapacitate it.