If cash is deposited it shall be with the clerk or a judge of the court having jurisdiction, and his receipt taken therefor and such deposit shall thereupon remain in the custody of the court until legal order of the court disposing of it, as security for all of the obligations of the party depositing it under this chapter, the same as if a written undertaking had been furnished specifically assuming said obligations.
SDCL 21-15-5