The fire marshal or deputy fire marshal, in order to enable them to discharge the duties required in the foregoing section, shall have power to administer oaths and affirmations in the discharge of the duties of his office, and a wilful violation of any oath or affirmation so administered by him, or wilfully and knowingly giving false testimony before him, shall be perjury; and he shall have power to compel the attendance of any person whom he may desire to examine in relation to any fire by subpoena and attachment; and if any person shall refuse to be sworn or affirmed or to testify in relation to any of the matters in regard to which it is the duty of the fire marshal to make investigation, or shall refuse to produce before the fire marshal any books, papers or documents in their possession which the said marshal may deem necessary to enable him to ascertain the truth in any investigation then being made by him, the said marshal shall have the power, upon the approval of the superintendent of county police and the authorized representative of the district attorney's office, to commit such person to the county jail until such person shall be willing to and shall be sworn or affirmed or testify or produce the books, papers and documents, as the case may be, and no longer: Provided, That no testimony taken under oath or affirmation before the fire marshal, as aforesaid, shall be used in evidence against the party giving it in any civil or criminal proceedings whatsoever, except in prosecutions against such party for perjury.
16 P.S. § 6106