The mechanism of metal corrosion passivation