The term "CD key" can be confusing for Knights of the Old Republic, so it helps to clear things up. In the game itself, a "CD" is an in-game item used to open and operate Chromium Droids you might encounter on your journey, which is unrelated to installation.
As for an installation key, the kind of anti-piracy code many PC games require, KOTOR and KOTOR 2 do not actually use one. This is likely because the games were originally built for the Xbox and later brought to PC. So if you were hunting for a string of numbers to install the game, the answer is that there is not one.