(a) General rule.--Any information gained by a city of the first class as a result of a tax audit, tax return, tax report, investigation of tax liability, administrative hearing regarding tax liability or verification with respect to tax liability shall be confidential tax information. It shall be unlawful, except for official purposes or as provided by law, for an officer, employee or agent of a city of the first class to:
(1) Divulge or make known in any manner any confidential information gained in any such return, investigation, hearing or verification to any person.
(2) Permit confidential tax information or any book containing any abstract or particulars thereof to be seen or examined by any person.
(3) Print, publish or make known in any manner any confidential tax information.
(b) Penalty.--A person who violates subsection (a) commits a misdemeanor of the third degree and shall, upon conviction, be ordered to pay a fine of not more than $2,500 and costs or to a term of imprisonment for not more than one year, or both. If the person is an officer or employee of the city, the officer or employee shall be dismissed from office or discharged from employment.