PREGERSON, Circuit Judge:
Appellant M. Larry Lawrence (“Lawrence”), a junior lienholder on a jet owned by the bankruptcy estate of J. David Dominelli (“Dominelli”), brought suit against appellee Steinford Holding B.V. (“Steinford”), a senior lienholder on the jet. Lawrence objected to Steinford’s lien on the ground that the loan from which it derived was usurious. The bankruptcy court held that Lawrence could not attack the loan as usurious because the estate’s trustee had brought and then settled a usury claim against Steinford. The district court affirmed the bankruptcy court’s ruling. Lawrence appeals from the district court’s ruling. We affirm. The trustee’s court-approved settlement of the estate’s usury claim against Steinford operates as res judicata to bar Lawrence from again raising the usury claim on behalf of the estate. Moreover, California law does not provide Lawrence with the right to raise the usury defense on his own behalf.
FACTS
In June 1983, Steinford lent Dominelli $3,150,000. Steinford took as security a lien on Dominelli’s Grumman Gulfstream II jet. The loan agreement provided that Dominelli would pay interest at the rate of 22% per annum.
On February 7, 1984, Lawrence lent Dominelli $1,000,000 at the prime rate plus one percent per annum. Lawrence’s loan was secured by a second lien on the same jet. Lawrence’s security agreement specifically was subject to and expressly recognized Steinford’s senior lien.
On February 13, 1984, involuntary petitions in bankruptcy were filed against Dominelli and his various business entities. On June 13, 1984, Lawrence filed suit against Steinford and the estate’s trustee in bankruptcy. In the suit, Lawrence sought to have the interest provisions of Steinford’s note declared void under California law. On July 19, 1984, Steinford brought a motion to dismiss Lawrence’s complaint. Steinford argued, among other things, that Lawrence was not entitled to raise the usury defense.
On July 24, 1984, the trustee (co-defendant in Lawrence’s action against Steinford) filed a cross-complaint against Steinford. The trustee sought a declaration that the interest provision of Steinford’s loan was void under California law and that the interest portion of the debt was therefore not secured within the meaning of 11 U.S.C. §§ 502 and 506. In addition, the trustee sought treble damages, as provided by Cal. Const, art. 15, Sec. 1.
On September 14, 1984, the bankruptcy court denied Steinford’s motion to dismiss Lawrence’s complaint on the ground that Lawrence, as a party in interest, was entitled to object to Steinford’s claim under 11 U.S.C. § 502. On November 7, 1984, the trustee applied to the bankruptcy court for approval of a proposed settlement between the trustee (on behalf of the estate) and Steinford. Under the settlement, Steinford would pay the estate $100,000 from the proceeds of the jet sale and would abandon Steinford’s claim to a $346,500 letter of credit that Dominelli had posted. In return, the trustee would dismiss the cross-complaint and “raise no objection to the lien claimed by Steinford.” Over Lawrence’s strenuous objection, the bankruptcy court approved the settlement. On December 11, 1984, the court entered an order allowing the jet to be sold, with Lawrence and Steinford’s liens attaching to the proceeds. In January 1985, the jet was sold, resulting in net proceeds of $3,600,000.
On March 19, 1985, Steinford brought a motion for reconsideration of the court’s September 14 ruling denying Steinford’s motion to dismiss Lawrence’s complaint. Steinford argued that the settlement of the usury action between the trustee and Stein-ford constituted changed circumstances justifying a reversal of the court’s original ruling. The bankruptcy court granted the motion and dismissed Lawrence’s complaint against Steinford. Lawrence appealed that order to the United States District Court for the Southern District of California. On February 4, 1986, Judge Irving of that court issued an order affirming the bankruptcy court’s decision. Lawrence appeals from the district court’s affirmance.
DISCUSSION
A. Lawrence’s Bight to Assert the Usury Defense
The district court’s rulings on the bankruptcy law issues are subject to de novo review. Comer v. Comer (In re Comer), 723 F.2d 737, 739 (9th Cir.1984).
The Bankruptcy Code, at 11 U.S.C. § 502(a), provides that “[a] claim or interest ... is deemed allowed, unless a party in interest, including a creditor of a partner in a partnership that is a debtor in a case under Chapter 7 of this title, objects.” Under the Bankruptcy Code, at 11 U.S.C. § 323, the trustee is the representative of the estate. Therefore, the trustee is a party in interest who may object to a claim under section 502(a). A creditor can also be a party in interest under section 502(a). See In re Williamson, 43 B.R. 813, 820 (1984); Collier on Bankruptcy ¶ 1502.01 (1986).
Lawrence contends that his right to object to the usurious loan has two components: (1) his right to raise the usury defense on behalf of the estate, and (2) his right to raise the defense on his own behalf. As the following discussion indicates, neither right obtains in this case.
1. Lawrence’s Bights as Representative of the Estate
Lawrence argues that his right to object to Steinford’s claim on usury grounds is “derivative from his debtor.” Lawrence contends that under 11 U.S.C. § 558, which describes defenses available to the estate, Lawrence, as a secured creditor, may bring an action asserting the estate’s defense even when the trustee has already asserted the same defense. Lawrence’s contention is incorrect.
Section 558 of the Code provides: “The estate shall have the benefit of any defense available to the debtor as against any entity other than the estate, including statutes of limitation, statutes of frauds, usury, and other personal defenses.” The estate was entitled to raise the usury defense that had been available to Dominelli. Section 323 of the Code states that the trustee is the representative of the estate. In this case, the trustee, acting as the estate’s representative, properly asserted the estate’s usury defense. Had the trustee brought no action, Lawrence would, as a creditor of the estate, have been authorized to raise the estate’s usury defense in his own action. However, Steinford correctly argues that the court’s order dismissing the trustee’s action operates as res judicata to bar Lawrence’s action against Steinford.
Under the doctrine of res judicata, “a final judgment on the merits bars further claims by parties or their privies based on the same cause of action.” Montana v. United States, 440 U.S. 147, 153, 99 S.Ct. 970, 973, 59 L.Ed.2d 210 (1979). Res judicata only applies if the same primary right is involved in the two actions, Amaro v. Continental Can Co., 724 F.2d 747, 749 (9th Cir.1984), and if the party against whom the earlier decision is asserted had a “full opportunity and fair opportunity to litigate the claim,” Kremer v. Chemical Const. Corp., 456 U.S. 461, 480 & n. 22, 102 S.Ct. 1883, 1897 & n. 22, 72 L.Ed.2d 262 (1982).
We hold that the settlement and dismissal of the trustee’s action against Steinford operates as res judicata to bar Lawrence from bringing his own action. The trustee’s action, resulting in a settlement of the claim and the district court’s approval of the settlement and dismissal of the action, amounts to a final judgment on the merits. See Bradford v. Bonner, 665 F.2d 680 (5th Cir.1982) (dismissal of action with prejudice pursuant to settlement bars later action). The rules of res judicata apply to Lawrence’s present attempt to assert the estate’s usury claim because, while arguably a party in the trustee’s action against Steinford, Lawrence is certainly a privy. For purposes of res judicata, privity exists where two parties represent the interests of the same entity. 1 B J. Moore, J. Lucas & T. Currie, Moore’s Federal Practice H 0.411[1] (2d ed. 1984). Just as the trustee represented the estate in the first action, Lawrence seeks to represent the estate in this action. This privity bars Lawrence from bringing an independent action on behalf of the estate. In addition, the same primary right is involved in the trustee’s action and in Lawrence’s action: It is the estate’s right to assert the usury defense, which derives from the debtor’s right to have done so before bankruptcy.
The remaining requirement, that the estate have had a full opportunity to litigate the claim in the first action, presents a more complicated question. When the rights of a secured creditor are implicated, a trustee’s action on a claim belonging to the estate does not necessarily extinguish the claim. A trustee’s action on a claim belonging to the estate provides the estate a full opportunity to litigate only if all relevant estate interests are represented before the bankruptcy court.
Ordinarily, the- trustee is the optimal party in interest to raise objections on behalf of the estate. See, e.g., Fred Reuping Leather Co. v. Fort Greene Nat’l Bank, 102 F.2d 372, 373 (3d Cir.1939). As Collier states:
[T]he right of a creditor to object to the allowance of another creditor’s claim should be undisputed on principle. Yet the needs of orderly and expeditious administration do not permit the full and unfettered exercise of such right. The most important qualification attached to the right of a creditor to object is that it is the trustee who acts as the spokesman for all the creditors in discharge of the trustee’s duty unless the trustee refuses to take action.
Collier on Bankruptcy ¶ 1502.01.
The rule that the trustee’s action challenging one creditor’s claim preempts another creditor’s right to object is more clearly applicable to general creditors than to secured creditors like Lawrence. As Lawrence points out, the cases cited in Collier deal primarily with general creditors. The trustee, as representative of the estate, normally can represent each general creditor as effectively as could the creditor itself. The law recognizes, however, that the trustee has interests that on occasion conflict with those of an individual secured creditor. See, e.g., Hyde Park Lumber Co. v. West Norwood Bldg. & Loan (In re Braker), 127 F.2d 652, 653 (6th Cir.1942); Smith v. Mortgage & Debenture Co. (In re Roche), 101 F. 956, 958 (5th Cir.1900); J.C. Wyckoff & Assoc, v. Aetna Casualty & Surety Co. (In re Wyckoff), 41 B.R. 791 (1984). In cases of conflict, all interests should be represented in the bankruptcy court.
In this case, such a conflict may exist. Lawrence, as a junior lienholder contesting the validity of a senior lien, has interests that appear to be at odds with the trustee’s interests. The trustee might wish to avoid spending estate money to pursue the usury action, while Lawrence might wish to do whatever is necessary to invalidate Steinford’s lien.
The problems posed by this conflict are remedied, however, by Lawrence’s having participated in the trustee’s action against Steinford. The bankruptcy court, when presented with the proposed settlement, was obliged to give notice to all interested parties and to entertain their objections. See Bankruptcy Rule 9019. Lawrence entered an objection to the settlement, and the court expressly overruled the objection. Thus, Lawrence had an opportunity before the bankruptcy court to represent his interests in relation to the proposed settlement. After duly considering Lawrence’s position, the court approved the settlement and granted Steinford’s motion to dismiss Lawrence’s complaint. Lawrence was entitled to appeal from the court’s order under 28 U.S.C. § 158(c), which permits appeals from the orders of bankruptcy judges. Lawrence did not exercise his right to appeal. Because the bankruptcy court during the settlement proceedings was able to consider the interests of the estate as a whole, which included the interests of Lawrence, there was a full opportunity for the court to consider and rule on the estate’s claim of usury. Therefore, the settlement and dismissal of the trustee’s action is res judicata barring Lawrence from relitigating the estate’s usury claim.
2. Lawrence’s Personal Rights
The district court’s interpretation of state law is reviewable de novo. Churchill v. Fjord (In re McLinn), 739 F.2d 1395, 1397 (9th Cir.1984) (en banc).
If the law provided Lawrence with a personal right of action for usury, he might be able to maintain his usury action against Steinford notwithstanding the trustee’s settlement with Steinford. Lawrence contends that, as a junior lienholder, he has a right to raise the usury defense on his own behalf. Under California’s usury cases, his argument is incorrect.
The California constitution at Art. 15 § 1 sets maximum interest rates for various types of loans. Lawrence’s complaint against Steinford alleges that the usurious interest rate on Steinford’s loan to Dominelli violated this constitutional provision.
According to California case law, the usury defense is personal to the borrower. Moe v. Transamerica Title Insurance Co., 21 Cal.App.3d 289, 300, 98 Cal.Rptr. 547, 554 (1971). “[0]ne who is not a party to the usurious contract may not attack it.” Domarad v. Fisher & Burke, Inc., 270 Cal.App.2d 543, 560, 76 Cal.Rptr. 529, 540 (1969). The only apparent exception to this rule is that one who stands in the shoes of the original borrower and is injured by the usurious interest rate may also assert the usury defense. See, e.g., Western States Acceptances Corp. v. Tuttle, Inc, 210 Cal. 51, 290 P. 574 (1930) (corporation formed by borrowers may assert usury defense); Sosin v. Richardson, 210 Cal.App.2d 258, 26 Cal.Rptr. 610, 614 (1962) (guarantor of loan may use usury defense where guarantee is dependent on usurious transaction). There is no indication in the California cases that a junior lienholder, particularly one who made a loan with notice of the senior lienholder’s usurious loan, is entitled to assert the usury defense. Therefore, the bankruptcy court correctly held that Lawrence had no basis under California law to raise a usury claim.
B. EQUITABLE SUBORDINATION
The Bankruptcy Code at 11 U.S.C. § 510(c) provides that a court, after notice and a hearing, may “subordinate for purposes of distribution all or part of an allowed claim to all or part of another allowed claim or all or part of an allowed interest to all or part of another allowed interest.”
This section applies the principles of equitable subordination as developed in the courts. Three elements are generally required before equitable subordination will be granted:
(i) The claimant must have engaged in some type of inequitable conduct.
(ii) The misconduct must have resulted in injury to the creditors of the bankrupt or conferred an unfair advantage on the claimant.
(iii) Equitable subordination must not be inconsistent with the provisions of the Bankruptcy Act.
Benjamin v. Diamond (In re Mobile Steel Co.), 563 F.2d 692, 699-700 (5th Cir.1977); see also Trone v. Smith (In re Westgate-Califomia Corp.), 642 F.2d 1174, 1177-78 (9th Cir.1981).
Because the bankruptcy court held that Lawrence was not entitled to assert the usury defense, the court made no finding of inequitable conduct by Steinford. Thus, the district court did not err in failing to provide equitable subordination as a remedy. In any event, Lawrence neither requested equitable subordination nor argued the need for it to the bankruptcy court.
We uphold the district court’s dismissal of Lawrence’s complaint.
AFFIRMED.
. Section 502(b) of the Bankruptcy Code provides that, if a party in interest raises an objection to a claim,
the court, after notice and a hearing, shall determine the amount of such claim ... and shall allow such claim in such amount, except to the extent that — (1) such claim is unenforceable against the debtor, and unenforceable against property of the debtor, under any agreement or applicable law for a reason other than because such claim is contingent or unmatured.
Appellant Lawrence argues that the usurious interest provision is unenforceable, notwithstanding the settlement agreement between the trustee and Steinford. Appellee Steinford argues that the settlement agreement rendered his claim enforceable.
. Lawrence strenuously argues that the trustee’s settlement of its cross-claim with Steinford did not render Steinford’s claim against the jet enforceable within the meaning of 11 U.S.C. § 502(b)(1). This refers to the statement in § 502(b)(1) that, after an objection to a claim is made, the court shall determine the amount of the claim "except to the extent that ... such claim is unenforceable against the debtor.” Lawrence cites a Fifth Circuit case for the proposition that the term "unenforceable” means whether the claim was enforceable before bankruptcy proceedings commenced. Appellant’s Brief at 21, citing Reagan v. Austin Municipal Federal Credit Union (In re Reagan), 741 F.2d 95 (5th Cir.1984) (per curiam). Under Lawrence’s reading, bankruptcy courts would be unable to render effective adjudication on claims because claims would be rendered permanently unenforceable (regardless, for example, of the parties’ desire to settle) by their pre-bankruptcy status.
. Under California law, if a transaction is usurious, generally the interest provision of the loan is void, but the principal of the loan is unaffected. Rochester Capital Leasing Corp. v. K & L Litho Corp., 13 Cal.App.3d 697, 703, 91 Cal.Rptr. 827, 831 (1970). Under some special statutes regulating lending organizations, the entire loan contract is void, so that neither principal nor interest can be received. Cal.Fin.Code §§ 22651 and 22652 (West 1981).