The correct answer is: B. Contract of surety

A contract of surety is a three-party agreement in which a surety agrees to be liable for the debt or obligation of another party, the principal debtor, to a third party, the creditor. The surety is essentially a guarantor of the principal debtor's debt. If the principal debtor fails to pay the debt, the surety is obligated to do so.

A contract of indemnity is a two-party agreement in which one party, the indemnitor, agrees to hold another party, the indemnitee, harmless from any losses or damages that the indemnitee may incur as a result of a particular event. The indemnitor is essentially a backstop for the indemnitee. If the indemnitee incurs losses or damages, the indemnitor is obligated to reimburse the indemnitee for those losses or damages.

A contract of pledge is a security interest in personal property that is given to a creditor as collateral for a debt. The creditor is called the pledgee, and the debtor is called the pledgor. The pledgee has the right to sell the pledged property if the debtor fails to repay the debt.

A contract of guarantee is a three-party agreement in which a guarantor agrees to be liable for the debt or obligation of another party, the principal debtor, to a third party, the creditor. The guarantor is essentially a co-signer on a loan. If the principal debtor fails to pay the debt, the guarantor is obligated to do so.

In conclusion, the only contract that has three parties consisting of creditor, principal debtor, and surety is a contract of surety.