Add the can of beans to a blender or food processor (with the liquid), and blend until creamy. If using cooked dry beans, add some water to make it a thick sauce-like consistency. Save for later.
In a large skillet over medium heat, add the olive oil. When oil is hot, add the prosciutto or bacon and onion. Cook until onion is tender and meat is about 1-2 minutes away from being crispy. Add the rosemary & garlic and cook for 1-2 minutes.
Add the beans, tomatoes, bay leaves, red pepper flakes and bring to a simmer. Let cook while you prepare the pasta.
Bring a large pot of salted water to a boil, add pasta, and cook according to package instructions.
Reserve about 1.5 cups of pasta cooking water and then drain pasta.
Return to pot and add sauce to the pasta (removing bay leaves).
Add grated cheese, and pasta water (in small batches) until desired consistency is reached.
Salt & pepper to taste.
Nutrition Info Per Serving: Calories 464.2 Total Fat 10.9 g Saturated Fat 3.1 g Polyunsaturated Fat 0.7 g Monounsaturated Fat 4.1 g Cholesterol 11.6 mg Sodium 421.9 mg Potassium 180.3 mg Total Carbohydrate 73.8 g Dietary Fiber 8.4 g Sugars 8.0 g Protein 19.4 g