
611 P.2d 1222 (1980)
STATE of Utah, Plaintiff and Respondent,
v.
Ralph W. FORSHEE, Defendant and Appellant.
No. 16350.
Supreme Court of Utah.
May 16, 1980.
*1223 Ronald J. Yengich, Salt Lake City, for defendant and appellant.
Robert B. Hansen, Atty. Gen., Craig L. Barlow, Asst. Atty. Gen., Salt Lake City, for plaintiff and respondent.
STEWART, Justice:
Defendant appeals from a conviction under § 58-37-8, Utah Code Annotated (1953), as amended, which prohibits distribution for value of a controlled substance  a third-degree felony. The sole issue on appeal is whether the trial court committed reversible error in refusing to require an undercover officer to disclose the name of an informant upon defendant's request.
In presenting its case the State produced a witness, Deputy Whittaker, to whom the alleged sale of marijuana was made. He began working as an undercover officer in April of 1978. On the 21st of that month, he called an informant who had arranged previous sales for him, all of which had fallen short of fruition. The undercover agent met the informant at the Delton Bowling Lanes in Granger two hours after the telephone conversation, at approximately 5:30 p.m. From there they traveled to another location just north of 3100 South 3450 West. At this destination, the undercover agent entered a residence wherein he met the defendant. Defendant's former wife, Vickie Forshee, and two children were present. The undercover officer testified at trial that the person he entered with was *1224 the confidential informant and that he lived at that residence with Vickie Forshee at the time, but that Whittaker did not know the whereabouts of the informer at the time of trial. Vickie Forshee pointed to a small plastic bag on the kitchen table. Whittaker sat at the kitchen table while the others remained in the living room, adjacent to the kitchen, where they apparently could see and hear the transaction. Defendant verified the quality of the contents, and Officer Whittaker gave the defendant $50 for the bag of marijuana. The undercover officer left the residence, leaving the informant behind, and turned the marijuana over to Deputy Sheriff Randall Anderson one hour later. Deputy Whittaker returned twice to the residence in an attempt to locate the defendant. He talked with Vickie Forshee both times. At the time of the second visit the informant was no longer living at Vickie Forshee's residence.
The testimony on behalf of the defendant consisted of his testimony and the testimony of his girlfriend, Val Densley, and of his ex-wife, Vickie Forshee. All three denied that the incident occurred and testified that they had never seen Officer Whittaker prior to the preliminary hearing or pretrial conference. Further, they all testified to the intense jealousy and hatred felt by Richard Garrett for the defendant and that Garrett had threatened to kill defendant on one occasion. Vickie Forshee testified that she lived with Richard Garrett from January to April when he severely beat her and she requested him to leave. Val Densley testified that she accompanied the defendant to Vickie Forshee's residence every time to avoid any problems with Richard Garrett, except once when defendant, knowing Richard Garrett would not be at the house, went to pick up the children.
There are two exceptions to the general privilege of nondisclosure of an informer's identity.[1] Disclosure is required (1) when the informer's identity is already known, and (2) when disclosure is essential "to assure a fair determination of the issues."
The codification in the Utah Rules of Evidence closely resembles the scope of the privilege set forth in Roviaro v. United States, 353 U.S. 53, 77 S.Ct. 623, 1 L.Ed.2d 639 (1957):
The purpose of the privilege is the furtherance and protection of the public interest in effective law enforcement. The privilege recognizes the obligation of citizens to communicate their knowledge of the commission of crimes to law-enforcement officials and, by preserving their anonymity, encourages them to perform that obligation.
The scope of the privilege is limited by its underlying purpose. Thus, where the disclosure of the contents of a communication will not tend to reveal the identity of an informer, the contents are not privileged. Likewise, once the identity of the informer has been disclosed to those who would have caused to resent the communication, the privilege is no longer applicable.
A further limitation on the applicability of the privilege arises from the fundamental requirements of fairness. Where the disclosure of an informer's identity, or of contents of his communication, is relevant and helpful to the defense of an accused, or is essential to a fair determination of a cause, the privilege must give way. [Footnotes omitted.] [Id. at 59-61, 77 S.Ct. at 627-628.]
Whether the court should require disclosure of an informer's identity, not otherwise *1225 known to the defendant, in a particular case, is a problem which properly requires a determination by the trial court based on a balancing of several factors, i.e., potential hazards to the safety of parties involved, the public interest in protecting the flow of information from informants, and the defendant's right to prepare his defense. Based on such factors the trial court must determine how the interests of justice will best be served. Roviaro v. United States, supra.
In support of his denial of the commission of the crime, defendant asserts that Richard Garrett, the man who he suspects was the informer, had reason to fabricate the whole story because of the hatred he felt for the defendant. He therefore contends that the identity of the informer was required because his testimony was material to a fair determination of defendant's guilt or innocence.
Generally, identity of an informer who was a witness to the crime with which the accused was charged or who was an actual participant in the commission of the alleged crime is subject to an order of disclosure. Gilmore v. United States, 256 F.2d 565 (5th Cir.1958); United States v. Barnes, 486 F.2d 776 (8th Cir.1973). Since the informant in this case was more than a mere informer of a crime that was about to occur and actually took an active part in arranging the meeting and witnessed the illegal sale, the request for disclosure on the instant facts, was, at first blush, warranted. In view of defendant's contentions regarding the nonoccurrence of the alleged illegal sale and the apparent bias of the informer, the defendant met the burden of establishing the informer as a material witness to his defense and thus was entitled to disclosure of the informer's identity. See State v. Celaya, 27 Ariz. App. 564, 556 P.2d 1167 (1976), and Costello v. United States, 298 F.2d 99 (9th Cir.1962). Furthermore, since the purpose of the privilege is to protect the informer from those who would have reason to resent his acting as an informer, defendant's knowledge of the informer's identity invoked the second exception to the privilege of nondisclosure.[2] However, it is defendant's very knowledge of the informer's identity that further served to vitiate any prejudice which may have otherwise resulted from the lower court's failure to require disclosure. Thus, the court's failure to require disclosure of the informer's identity, in any event, is at best harmless error. Sorrentino v. United States, 163 F.2d 627 (9th Cir.1947).
Roviaro stated that it could not be assumed from the record in that case that an informer's identity was known to the defendant and that disclosure was necessary because his possible testimony was likely to be highly relevant. The Supreme Court accordingly held that prejudice resulted from the trial court's failure to require disclosure. The record in the present case demands a contrary determination.
It is clear in the instant case that the defendant knew the identity of the informant. Counsel for defendant put the question to Deputy Whittaker, "Is the informant's name Richard Garrett?" Although the objection to that question was sustained, the officer testified that he entered the residence where the sale was made with the informer and that the informant was living there at the time with defendant's ex-wife. The defendant testified that he knew Richard Garrett and that he knew that Richard Garrett was living with Vickie Forshee, the defendant's ex-wife. Therefore, defendant not only knew Richard Garrett, he knew from the testimony of the deputy officer that Richard Garrett was the informant. The need for disclosure was academic; stating the name by the police officer would have been a futile exercise, and the failure to so state was not prejudicial in any way to the defendant. See Sorrentino v. United States, supra. Furthermore, *1226 Vickie Forshee, defendant's witness and ex-wife, testified to knowledge of Garrett's whereabouts, but defendant made no effort to subpoena him for the purpose of testifying.[3]
If any error were committed in the court's refusal to require the State to reveal the identity of the informant, it was not prejudicial.
The judgment of the trial court is affirmed.
CROCKETT, C.J., and MAUGHAN, WILKINS and HALL, JJ., concur.
NOTES
[1]  Rule 36 of the Utah Rules of Evidence provides:

A witness has a privilege to refuse to disclose the identity of a person who has furnished information purporting to disclose a violation of a provision of the laws of this state or of the United States to a representative of the state or the United States or governmental division thereof, charged with the duty of enforcing that provision, and evidence thereof is inadmissible, unless the judge finds that (a) the identity of the person furnishing the information has already been otherwise disclosed or (b) disclosure of his identity is essential to assure a fair determination of the issues.
[2]  Since the informer was no longer working for the government, a need to protect his cover in the interest of further crime prevention did not exist.
[3]  The testimony suggested that the informer was serving a sentence in a California prison. Yet defendant apparently made no attempt to obtain his testimony either by process of the Uniform Act to Secure the Attendance of Witnesses from Without a State in Criminal Proceedings (Calif.Penal Code § 1326-1332; Utah Code Ann. § 77-45-11 to 77-45-18 (1953), as amended), or by Examination of Witnesses on Commission as provided for by Utah Code Ann. § 77-47-1 to 77-47-14 (1953), as amended.
