Export certificate and key from Keychain access (apns-dev-cert.p12, apns-dev-key.p12) Development Phase: Step 1: Create Certificate .pem from Certificate .p12 Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 Step 2: Create Key .pem from Key .p12 Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 Step 3: Optional (If you want to remove pass phrase asked in second step) Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem Step 4: Now we have to merge the Key .pem and Certificate .pem to get Development .pem needed for Push Notifications in Development Phase of App Command : cat apns-dev-cert.pem apns-dev-key-noenc.pem > apns-dev.pem (If 3rd step is performed ) Command : cat apns-dev-cert.pem apns-dev-key.pem > apns-dev.pem (if not) Step 5: Check certificate validity and connectivity to APNS Command: openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns
Blog của Long Hoàng Giang - Keep in memory