This is one of the process I hate a lot. After reinstalling all things on my laptop, I have to setup the deployment assets (certificate and keys) again. I can not remember how I did this for the first time. The only thing I can remember is that it is a painful step. Ok, no worry, let's try again and I will make a note this time.
There are two big things to do: create a certificate and create a provisition profile. Here are the steps.
1. Create a certificate request. Open keychain access, then select request certificate. Select save to disk instead of adding ca mail.
2. Sumbit the request file in apple provision portal.
3. Download the certificate, double click to install. Now check if the certificate contain your key set or not.
4. Create provision key in provision portal page, choose the certificate that is just created.
5. Download the provision key, drag it to xcode. In the organizer, sign in to verify those key.
There are more detail before the setup is completed, but the above step covers the main task.