It fits in a half moon shaped notch machined into the crank shaft. Only 1/2 of the key height will fit into the slot (rounded side into slot, longer flat side facing up).
You superglue the key into the notch to hold it there (wait for the glue to dry) so it will resist falling out when the magnetic rotor is slid onto the shaft.
The magneto's magnetic rotor has a matching slot that the other half of the key fits into.
It can be tricky to get the rotor to slide onto the shaft without popping the key out of the notch on the shaft, even though you superglued it in. Patience is a virtue.
It will help to remove the coil from the engine first. that way you will not be fighting the magnetic force trying to pull the rotor every which way.