Cal. Harb. & Nav. Code § 817
The master of a vessel in case of its capture may engage to pay a ransom for it in money or in part of the cargo, and his engagement will bind the vessel, freightage, and cargo.