Preheat the oven to 350°F (180°C). In a bowl, mix together the nuts, salt, and rosemary, if using.
Spread the nuts in a single layer on a rimmed baking sheet. Place in the oven and toast, stirring several times, until fragrant and starting to turn golden, about 10 minutes. Pour onto paper towels and let cool to room temperature.
Transfer to a bowl to serve. The nuts will keep, stored in an airtight container at room temperature, for up to 1 week.