We develop a general and efficient method for valuating credit derivatives based on multiple entities in an affine framework. This includes interdependence of market and credit risk, joint credit migration and counterparty default risk of multiple firms. As an application we provide closed form expressions for the joint distribution of default times, default correlations, and credit default spr...