It's not that easy. There are two other components. The contacts in the cylinder and the decoder or VATS reader.
The decoder is an additional computer which is usually found in a very difficult place to get to. Mine in the STS is buried inside the dash way up high.
To sum it up. If the contacts in the ignition cylinder are worn then you need to replace the cylinder. A way to test this is to measure the resistance of the key and get a resistor of that exact rating.
Locate the pink wire, I think it's pink. Maybe it's yellow but you'll see it. It will have a small plug on it right there at the base of the steering column. Unplug it. Jump the side going to the computer, not up the steering column, with the resistor.
If the problem goes away it's the cylinder. If not it's the reader (decoder)