It shall be lawful for any party of whom a bond or undertaking is required to agree with his sureties for the deposit of any or all moneys for which said sureties are or may be held responsible with a trust company authorized by law to receive such deposit, if such deposit is otherwise proper, and for the safekeeping of any and all other depositable assets for which said sureties are or may be held responsible with a safe deposit company authorized by law to do business as such, in such manner as to prevent the withdrawal of such moneys and assets, or any part thereof except with the written consent of such sureties, or an order of the court made on such notice to them as such court may direct.
8 P.S. § 11