Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I convert p8 APNs Auth Key to pem file?

I using *.p8 APNs Auth Keys instead of *.p12 certificates for push notification of my apps.

And, push notifications were working well.

However, a third party SDK which I needed and related to push notification demands only *.pem files from me, not *.p8.

If I want to use only *.p8 for APNs, I can't use this SDK now. It's right?

like image 225
Byoth Avatar asked Oct 17 '19 03:10

Byoth


1 Answers

You can do this by using openssl. You can convert the .p8 to .pem using below command:

If the .p8 private key is encrypted:

openssl pkcs8 -in AuthKey.p8 -out AuthKey.pem

If the .p8 private key is not encrypted:

openssl pkcs8 -nocrypt -in AuthKey.p8 -out AuthKey.pem

APNS and Sign in with Apple *.p8 keys, provided by Apple are unencrypted.

like image 182
christijk Avatar answered Nov 30 '22 02:11

christijk