Buying a car without keys

I bought a 1998 ram 2500 with no keys. A locksmith came out and did his thing. Took off the door panel, made a key and had to do something with the computer/ electronics so the security system would recognize the new key. Cost was $300 bucks.