Generation of Emission Credits in the Magnesium Sector