Every person who shall falsely represent or personate another, and in such assumed character shall marry another, or become bail or surety for any party in any proceeding, civil or criminal, before any court or officer authorized to take such bail or surety; or confess any judgment, or acknowledge the execution of any conveyance of real estate, or of any other instrument which by law may be recorded; or do any other act in the course of any suit, proceeding, or prosecution, whereby the person so represented or personated might be made liable in any event to the payment of any debt, damages, costs, or sum of money, or his rights or interests in any manner be affected if the same were legal shall, upon conviction, be punished by imprisonment in the penitentiary for a term not exceeding ten years. An indictment under this section for marrying shall not be found unless on the complaint of the injured party, before cohabitation, after knowledge of the fraud.