Any receiver, assignee, guardian, trustee, committee, executor, administrator, curator, or other fiduciary required by law or the order of any court to give a bond or other obligation as such may include, as a part of the lawful expense of executing his trust, such reasonable sum paid a company authorized under the laws of this state so to do for becoming his surety on such bond as may be allowed by the court in which he is required to account, not exceeding one percent per annum on the amount of such bond or other obligation. A party to any action, suit, or proceeding entitled to recover costs in such action, suit, or proceeding shall be allowed and may have taxed and may recover, as costs therein, such sum as said party has paid such a company as premium for executing any bond, recognizance, undertaking, stipulation, or other obligation therein, not exceeding five dollars per annum for each thousand dollars or fraction thereof of the penalty of such bond, recognizance, undertaking, stipulation, or other obligation for each year or part thereof that the same has been in force. The premium so paid shall be taxed by the clerk of the court in which such action, suit, or proceeding is pending, as costs therein, upon production to him of proper receipt for the payment of such premium, which receipt shall be by him filed with the papers in the cause.