In Pokémon Diamond and Pearl, the Galactic Key is handed over by a Team Galactic Grunt — specifically the one running the building in Veilstone City where the Galactic hideout entrance is hidden.
If you cannot find the building, remember that Veilstone's layout is a grid — the Galactic presence is in the block just behind the department store area, and the running Grunt is your marker that you are in the right place.