I'm guessing here but I think it is the car that has to be programmed, not the key.
I imagine the dealer connects the car up to a laptop computer and the mechanic programmes the set up with that. With a bit of luck if you beat your dealer hard enough over the head he'll do it FOC whilst he's installing the wind deflector.