
225 B.R. 180 (1998)
In re Garry RINDLISBACHER, Debtor,
Dennis R. DUBROW, Appellant,
v.
Garry RINDLISBACHER, Appellee.
BAP No. CC-97-1831-PJO, Bankruptcy No. SV 96-20697 KL, Adv. No. SV 96-01861 KL.
United States Bankruptcy Appellate Panel of the Ninth Circuit.
Argued and Submitted on July 21, 1998.
Decided September 3, 1998.
*181 Silvio Nardoni, Glendale, CA, for Dennis R. Dubrow, appellant.
Phillip Banfield, Taylor & Banfield, Lancaster, CA, for Garry Rindlisbacher, appellee.
Before PERRIS,[1] JONES and OLLASON, Bankruptcy Judges.

OPINION
PERRIS, Bankruptcy Judge.
This appeal involves the interplay of an attorney's professional and legal responsibilities to a former client and the attorney's rights as a creditor in the bankruptcy context. The bankruptcy court granted debtor/defendant's motion for summary judgment on plaintiff Dubrow's complaint to deny debtor a discharge under 11 U.S.C. § 727(a), holding that Dubrow had violated his ethical and legal obligations to his former client in pursuing the complaint. Dubrow appeals and we AFFIRM.

FACTS
Dubrow, an attorney, represented debtor in a dissolution action. During questioning *182 by opposing counsel at the trial of the dissolution case, debtor denied that he had received rental income from a rental home that debtor and his wife owned. During a recess in the trial, Dubrow asked debtor whether he had in fact received rent, and debtor said that he had.
Sometime after the dissolution trial, debtor filed his Chapter 7 petition. He did not list the rental income on his Statement of Affairs. After debtor filed bankruptcy, Dubrow verified that renters had lived in debtor's property before bankruptcy.
Dubrow then filed this complaint to deny debtor a discharge based on debtor's failure to reveal the rental income on his Statement of Affairs, failure to satisfactorily account for the rental income, and failure to keep or preserve books or records.[2] During discovery, debtor answered Dubrow's interrogatories and deposition questions regarding his receipt of rental income, and answered a deposition question regarding the content of the conversation he had with Dubrow during the recess in the dissolution trial. Debtor moved for summary judgment, arguing that Dubrow improperly used confidential client information in bringing this proceeding. The bankruptcy court granted the motion, and Dubrow appeals.

ISSUE
Did the bankruptcy court err in granting debtor's motion for summary judgment based on Dubrow's violation of attorney confidence rules?

STANDARD OF REVIEW
The Panel reviews de novo a bankruptcy court's decision to grant summary judgment. In re Baird, 114 B.R. 198, 201 (9th Cir.BAP 1990). Viewing the evidence in the light most favorable to the non-moving party, the Panel determines whether the bankruptcy court correctly found that there are no genuine issues of material fact and that the moving party is entitled to summary judgment as a matter of law. Id.; Fed.R.Bankr.P. 7056; Fed.R.Civ.P. 56(c).

DISCUSSION
This case involves the interaction of the California ethical rules governing the conduct of attorneys and the attorney client privilege.[3] The bankruptcy court held that Dubrow violated his statutory duties under California Business and Professional Code § 6068(e) and the attorney client privilege by using information he obtained while acting as debtor's attorney as the basis for this adversary complaint. Debtor also asserts that Dubrow violated California Rule of Professional Conduct 3-310(E).
A. The communication was confidential.
Section 6068(e) provides that it is the duty of an attorney to
"maintain inviolate the confidence, and at every peril to himself or herself to preserve the secrets, of his or her client."
Rule 3-310(E) provides:
"A member shall not, without the informed written consent of the client or former client, accept employment adverse to the client or former client where, by reason of the representation of the client or former client, the member has obtained confidential information material to the employment."
In addition, a client has the privilege "to refuse to disclose, and to prevent another from disclosing, a confidential communication between client and lawyer. . . ." Cal.Evid. Code § 954.
Both section 6068(e) and Rule 3-310(E) are aimed at protecting the confidential relationship between an attorney and client. Jeffry v. Pounds, 67 Cal.App.3d 6, 9, 136 Cal.Rptr. 373 (1977).
"The object of the privilege is to enhance the value which society places upon legal representation by assuring the client the *183 opportunity for full disclosure to the attorney unfettered by fear that others will be informed."
Glade v. Superior Court, 76 Cal.App.3d 738, 743, 143 Cal.Rptr. 119 (1978).
The general rule is that an attorney may reveal confidences and secrets where it is necessary to do so to get paid or to defend himself against charges of improper conduct. United States v. Ballard, 779 F.2d 287, 292 (5th Cir.), cert. denied, 475 U.S. 1109, 106 S.Ct. 1518, 89 L.Ed.2d 916 (1986); In re Featherworks Corp., 25 B.R. 634, 645 (Bankr. E.D.N.Y.1982), aff'd on other grounds 36 B.R. 460 (E.D.N.Y.1984). Unlike the Model Rules of Professional Conduct and the American Bar Association's Code of Professional Responsibility, cited in those cases, the California ethical rules relating to duties of an attorney do not contain any explicit exception allowing use of client confidences when it is necessary to defend the attorney's rights.
The exception to the prohibition on disclosure of client confidences is, however, codified in California's privilege rules. The privilege does not apply to any "communication relevant to an issue of breach, by the lawyer or by the client, of a duty arising out of the lawyer-client relationship." Cal.Evid. Code § 958. Under this rule, the attorney is released from the obligations of secrecy when the disclosure of communications, otherwise privileged, becomes necessary to the protection of the attorney's own rights, such as when the attorney's integrity, good faith, authority or performance of duties is questioned. Arden v. State Bar of Cal., 52 Cal.2d 310, 320, 341 P.2d 6 (1959); Carlson, Collins, Gordon & Bold v. Banducci, 257 Cal.App.2d 212, 227-28, 64 Cal.Rptr. 915 (1967). Thus, an attorney may reveal confidences and secrets where it is necessary to do so to get paid. In re Featherworks Corp., 25 B.R. at 645. According to the California Law Revision Commission, the reason for this exception is that it would be "unjust to permit a client . . . to refuse to pay his attorney's fee and invoke the privilege to defeat the attorney's claim." 7 Cal.L.Rev.Comm. Reports 1 (1965).
There is no question that debtor's communication to Dubrow that he had lied at the dissolution trial was confidential when made. The question is whether Dubrow's use of that communication in this discharge proceeding is related to Dubrow's protection of his own rights against a breach of a duty by debtor. We conclude that it is not.
Debtor acknowledges that the purpose of this adversary proceeding to deny debtor a discharge is to enable Dubrow to collect his fees. That does not necessarily mean that the use of the otherwise confidential communication to deny debtor a discharge is the type of use that is allowed under the ethical rules and the privilege. The idea behind the exception to the confidences rule for collection of an attorney's fee is that the client has breached a duty by failing to pay, and the attorney must be able to defend himself against the client's charges of attorney misconduct. In other words, the client puts the attorney's actions in issue and, in fairness, the attorney must be allowed to defend, even if that defense involves the use of communications that the attorney would otherwise be bound to maintain as confidential.
A debtor's pursuit of a discharge is not a breach of the duty to pay; it is a right provided by the Bankruptcy Code. By seeking a discharge the client does not in any way call into question the validity of the attorney's fee or the attorney's actions. He merely seeks to obtain a benefit that the law allows. Because there is no breach of duty by the client, and no claim against the attorney which the attorney must in fairness be permitted to defend, the exception to the confidences rule for disclosure of communications necessary to allow the attorney to collect a fee does not apply.[4]
*184 B. The privilege was not waived.
A client may waive the privilege to refuse to disclose confidential information.
Except as otherwise provided in this section, the right of any person to claim a privilege provided by Section 954 . . . is waived with respect to a communication protected by such privilege if any holder of the privilege, without coercion, has disclosed a significant part of the communication or has consented to such disclosure made by anyone. Consent to disclosure is manifested by any statement or other conduct of the holder of the privilege indicating consent to the disclosure, including failure to claim the privilege in any proceeding in which the holder has the legal standing and opportunity to claim the privilege.
Cal.Evid.Code § 912(a).
In this case, debtor answered interrogatories and questions at his deposition regarding his receipt of rental income. Debtor also answered affirmatively Dubrow's deposition question about whether debtor had told Dubrow that he had received rental income. Ordinarily, where a client is present at a proceeding, consults with counsel, and then testifies about confidential information, the privilege is waived. Calvert v. State Bar of California, 54 Cal.3d 765, 780, 1 Cal. Rptr.2d 684, 819 P.2d 424 (1991).
We conclude that, under the facts of this case, debtor did not waive the privilege by responding to Dubrow's discovery requests. An attorney has the duty to preserve the confidences of the client at every peril to himself and to assert the privilege for the client even after the attorney-client relationship ends. Cal.Bus. & Prof.Code § 6068(e); Cal.Evid.Code § 955; 2 Witkin, California Evidence § 1124 (3d ed.1986); Vol. VIII Wigmore, Evidence § 2323 (1961). An attorney who brings an action against a former client based on facts the attorney learned in confidence, and with regard to which no exception or waiver applies, breaches that duty by filing the action. The attorney further breaches that duty by seeking discovery from the former client that would require the former client to waive the privilege.
The attorney cannot, consistent with the duty to preserve confidences and to claim the privilege on behalf of the former client, ask the now-adversary client questions that can be answered only by revealing information the attorney learned in confidence.[5] Holding that the client waives the privilege by answering questions an attorney asks that are based on information obtained in confidence would undermine the policy of preserving the confidentiality of the attorney-client relationship. The attorney cannot be allowed to pursue the client to the client's detriment, using as a sword information obtained from the client in confidence.
C. There is no material issue of fact.
Dubrow argues that he independently verified the rental income, using information that was not confidential. Therefore, he asserts, he should be able to pursue this claim.
There is no question that the foundation for this adversary proceeding was Dubrow's knowledge that debtor had lied about not receiving rents from his rental property. Although Dubrow attempts to distance himself from that knowledge by asserting that he verified the facts independently of the confidential information, that attempt must fail. Having obtained the information in confidence, Dubrow cannot pretend that his action is based on nonconfidential information by claiming to have verified independently the information that he had obtained in confidence.
The purpose of the ethical and privilege rules regarding client confidences is to encourage full disclosure to the attorney free from fear that the information will be disclosed to others, thereby "promot[ing] broader public interests in the observance of law and administration of justice." Upjohn Co. v. United States, 449 U.S. 383, 389, 101 S.Ct. 677, 66 L.Ed.2d 584 (1981). Allowing an attorney to circumvent the confidences rules by independent verification would defeat that *185 purpose and could make clients reluctant to be fully forthcoming in their discussions with their attorneys.
We hold that, where the attorney obtains information in confidence from the client, the attorney cannot later use that information, whether independently verified or not, as the basis of a proceeding against the client to deny discharge. The bankruptcy court did not err in granting debtor summary judgment.

CONCLUSION
Dubrow's complaint is barred by his ethical obligations and his obligations under the attorney client privilege to preserve client confidences. We AFFIRM the order granting summary judgment.
NOTES
[1]  Hon. Elizabeth L. Perris, Bankruptcy Judge for the District of Oregon, sitting by designation.
[2]  At the time debtor filed bankruptcy, he owed Dubrow approximately $24,000 for attorney fees.
[3]  Because the underlying action in which the attorney-client relationship existed was based on state law, California law governs debtor's assertion of the privilege in this case. See Fed.R.Evid. 501 (in actions in which state law provides the rule of decision, privileges are determined by state law).
[4]  We do not think that Dubrow violated Rule 3-310(E), which prohibits representation of interests adverse to a former client. Dubrow is not undertaking representation of an interest adverse to debtor; he himself has an interest adverse to debtor. If debtor is correct that Rule 3-310(E) prohibits an attorney from ever acquiring an interest contrary to the client without the client's written consent, an attorney could never pursue collection of an attorney fee without the client's written consent. That is not the law.
[5]  There might be a different result if the communication fits within one of the exceptions to the confidence rules, such as fraud, or if the client has waived the privilege.
