Generate a PEM file from the Mac for push

Source: Internet
Author: User
Tags openssl openssl rsa pkcs12

http://blog.csdn.net/andrew57/article/details/20052381

Record the following mainly used for a long time, you will forget, but also requery.


1. Start the Keychain-->login keychain--> certificates classification on the Mac. You will see development, publishing, and push certificates. "Apple Development push Services" is the push certificate prefix, which is the secret key after the certificate is expanded.

2. Extend this option and then right-click "Apple Development push Services" > Export "apple Development push Services:app ID". Save as a apns-cert.p12 file.

3. Extended "Apple Development Push Services" to the "Private Key" to do the same operation, save as a apns-key.p12 file.

4. Open terminal to convert p12 file to PEM format:

OpenSSL pkcs12-clcerts-nokeys-out apns-cert.pem-in APNS-CERT.P12
OpenSSL pkcs12-nocerts-out apns-key.pem-in APNS-KEY.P12

5. Need to remove the password, export/conversion do not set or execute:
OpenSSL rsa-in apns-key.pem-out Apns-key-noenc.pem

6. Merging certificates and keys, using SSL to connect to APNs will use:
Cat Apns-cert.pem Apns-key-noenc.pem > Apns-dev.pem


Or:

1.

OpenSSL pkcs12-clcerts-nokeys-out apns-cert.pem-in APNS-CERT.P12

Do not encrypt, to encrypt remove-nodes

OpenSSL pkcs12-nocerts-out apns-key.pem-in apns-key.p12-nodes

2. The merger

Cat Apns-cert.pem Apns-key.pem > Apns-dev.pem

Window below is:

copy/b Apns-cert.pem+apns-key.pem Apns-dev.pem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.