Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Creating .p12 for apns with server side in Java

    • 0
    • 0
    • 0
    • 0
    • 2
    • 0
    • 0
    • 0
    • 894
    Comment on it

    Generally in iOS apps server side is coded in PHP and to integrate APNS we can create .pem file by following this RayWenderlich tutorial.

    But we might face difficulty in receiving remote notification on device when server side coding is done in Java. This is because the private key p12 file doesn't work with Java. We should use following OpenSSL commands to generate another p12 file from the private key and the .cer download from Apple. This new file is actually the correct one to be used with Java.


    aps_dev.cer -> downloaded from Apple developer
    private_key.p12 -> private key


    1. openssl x509 -in aps_dev.cer -inform DER -out aps_dev.pem -outform PEM
    2. openssl pkcs12 -nocerts -in private_key.p12 -out private_key.pem
    3. openssl pkcs12 -export -inkey private_key.pem -in aps_dev.pem -out aps_dev_java.p12


    Finally we should use aps_dev_java.p12 at server end for sending notifications.

 2 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: