...if wet from plain Water...it can be spread out on something, air dried or sun dried, and be good as new.
Well perhaps if you were in the desert, but if you were on a island or had high humidity like an East Coast Southern State, you would be sore pressed to make it work by simply air or sun drying.
One of the standard techniques was to take a piece of tinned iron, heat it over a fire, until hot but not so hot it would burn flesh on instant contact, just hot enough so that you didn't want to hold it very long in your hand..., remove the tinned iron a good distance from the fire, then spread out the powder in a thin layer on top of the tinned iron to drive out the moisture.
There is documentation of several Indians trying to do this very thing, but omitted removing the tinned iron from the heat source and moving off a distance, plus doing a small test batch..., it ended in a tragedy.
If your powder was open in a powder magazine on a ship..., and water entered from the top, but did not escape out the bottom or sides washing away the nitrate, the potassium nitrate would be concentrated in the bottom of the keg. You could remove the powder, after it had dried a bit to the consistency of clay, remix it by hand adding some urine if it got too dry while mixing..., and then dry it, screen it, dry it some more, and it would probably work.
Sea water contamination might give it funny colors when firing due to the salts, or it might not work at all.
Could powder in a wrecked ship survive? Sure if it stayed dry, but I doubt it would if it was submerged for any length of time.
LD