I am running the application from ubuntu (can that cause the problem?). The person that is an agent in the apple developers program has generated the p12 and the pem twice for me from his computer following these instructions:

Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.