Credit risk modeling with affine processes