In law a witness might be compelled to provide testimony in court, before a grand jury, before an administrative tribunal, before a deposition officer, or in a variety of other legal proceedings. A subpoena is a legal document that commands a person to appear at a proceeding. It is used to compel the testimony of a witness in a trial. Usually, it can be issued by a judge or by the lawyer representing the plaintiff or the defendant in a civil trial or by the prosecutor or the defense attorney in a criminal proceeding, or by a government agency. In many jurisdictions, it is compulsory to comply and with the subpoena and either take an oath or solemely affirm to testify truthfully under penalty of perjury.