Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So the answer as BorrajaX suggested was to not set a password for the key when prompted. However this is not possible as (at least on my Mac) wants the password to be a minimum 4 characters.</p> <p>The steps to fix this are:</p> <ol> <li>Create the certificate in the developer portal.</li> <li>Download and open the certificate locally in Keychain Access</li> <li>Export the certificate’s private key as a .p12 file from Keychain Access (I named it aps_key.p12).</li> <li>Run the following on the .p12 key:<br> <code>openssl pkcs12 -nocerts -out aps_key.pem -in aps_key.p12</code></li> <li>Enter a password (which we will strip in a minute).</li> <li>Run the following to strip the password:<br> <code>openssl rsa -in aps_key.pem -out new_aps_key.pem</code></li> <li>Convert the .cer downloaded from the Developer Center to a .pem file:<br> <code>openssl x509 -in aps.cer -inform der -out aps.pem</code></li> <li>Merge the key and certificate .pem files with the following:<br> <code>cat aps.pem new_aps_key.pem &gt; final_aps.pem</code></li> <li>You can now delete all other files, except for <code>final_aps.pem</code>.</li> </ol> <p>The <code>final_aps.pem</code> file then works with the code above without getting prompted for a password/pass phrase.</p> <p>This is a useful website where I found the code for removing the password from the .pem file: <a href="http://www.sslshopper.com/article-most-common-openssl-commands.html" rel="nofollow">http://www.sslshopper.com/article-most-common-openssl-commands.html</a></p> <p>Edit: If you don't need the certificate and the key in the same file, you can just ignore step 8 and use the <code>aps.pem</code> and <code>new_aps_key.pem</code> files.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload