title: Xcode Code Sign error because of no Keys in Keychain
body: <p>You might think, not again such a question where are already thousands of topics about. However, I've not been capable of finding the answer I needed to fix this problem.</p>
  <p>None of these topics go as deep as the Keychain.</p>
  <p>When I'm trying to deploy my app to an iPhone, I'm receiving the following message:</p>
  <pre><code>Code Sign error: The identity 'iPhone Developer: [Name] ([ID])' doesn't match any valid, non-expired certificate/private key pair in your keychains.
  </code></pre>
  <p>Now, as said, I have been looking for multiple guides or fixes, however, none of them seemed to fix this issue.</p>
  <p>Things I've tried:</p>
  <ul>
  <li>Use Apple's walkthrough for app deployment for countless of times</li>
  <li>Searched the internet for guides for app deployment</li>
  <li>Changed the content of the 'pbxproj' file inside the 'xcodeproj' package.</li>
  <li>Retrieve all available profiles from Apple's server using the Refresh button in Xcode 4.6 (allows you to obtain automatically)</li>
  </ul>
  <p>After trying all of these ways, I've still not been able to solve the issue. One problem I've seen is that at first hand, the certificate in the Keychain was showing an invalid status, which is now solved.</p>
  <p>However, if I'm right, there are supposed to be two keys attached to the certificate. A public and private key, and these are not showing.</p>
  <p>Neither are there any keys showing in the Keys tab in the Keychain Access.</p>
  <hr />
  <h3>Solution</h3>
  <p>(Thanks to nsgulliver)</p>
  <ol>
  <li>Do everything what the post (marked as Solution) of nsgulliver says.</li>
  <li>If you already have an active Certificate, click the Revoke button, this won't cause any trouble, you'll simply have to re-create the keys of which then will be generated a new certificate.</li>
  <li>Make sure you have the WWDR of Apple installed to mark the certificate authority as valid.</li>
  <li>Follow the default Provisioning Assistant guidelines.</li>
  </ol>