Every person not subject to naval law, who,—
- being duly summoned or ordered to attend as a witness before a court-martial or disciplinary court fails to attend without due cause, or
- refuses to take an oath or make an affirmation legally required by a court-martial or disciplinary court to be taken or made, or
- being sworn or affirmed, refuses to answer any questions put by or before a court-martial or disciplinary court, which he is in law bound to answer, or
- refuses to produce or deliver up a document in his power which the court-martial or disciplinary court may legally demand, or
- is guilty of contempt of court-martial or disciplinary court,
shall be punished with imprisonment for a term which may extend to two years, or with fine, or with both.