A. Where assets belonging to others, shall be pledged or given as collateral by an institution of which the secretary subsequently takes possession as receiver, and the pledgee has actual knowledge at the time of the pledge that the assets are not assets of the institution, such pledgee shall not forfeit or sell any such collateral or pledged assets, after the secretary has taken possession, without the written permission of the secretary, any provision in any collateral note or agreement to the contrary notwithstanding; but if the secretary refuses such permission, the pledgee may, after notice to the secretary, petition the court for leave to sell such assets. The court may, after giving the pledgee and the secretary an opportunity to be heard, grant such leave, or it may make such other order as it deems to be in the best interests of all parties concerned. However, if the assets so pledged by any such institution are accompanied by the obligation of the corporation or person owning them, the pledgee shall have the power to exercise all the rights, powers, and privileges contained in such obligation held by such pledgee, including the sale of the assets.