Galvanic Corrosion

As a basic rule, only metal of the same or almost the same nobility should be combined in a corrosive environment.

Galvanic corrosion occurs when two dissimilar metals with different voltage potentials are in contact with each other in the presence of an electrolyte (damp film or seawater / fresh water). When this happens, the less noble metal becomes the anode and the more noble metal the cathode. 
For example, if a steel screw is fixed into a copper plate, the screw will be the anode since copper is the nobler metal. The screw will rust rapidly as the difference in potential is great

If the same steel screw is fixed into a less noble plate, eg a zinc plate, the screw will be the cathode and will not rust. The zinc plate will corrode, as it is less noble than the screw.

For these reasons, it is important that all securing devices are of the stainless steel type or other corrosive resistance materials. This applies to cotter pins, safety pins, securing wire, and locking wire for threading through nuts and bolts, etc..
Certain working environments apply strict controls and guidance with regard to the introduction of alloys. Always check first.