2

I am having some trouble creating my .p12 certificate. I have previously created an application with push notification, this works fine. The application takes the users device id and saves it into a database.

I have added the code into my new application(with the amendments to work with the new application), and from the Log it seems to be working in the same way as my other app.

I have downloaded the relevant files that i need and then i know i needed to use ssl to be able to create my new and combined p12. I cant for the life of me remember how i created the p.12 file.

I'm using moonapns.

I have used the following:

Step 1:

openssl x509 -in aps_developer_identity.cer -inform DER -out aps_developer_identity.pem -outform PEM}

Where aps_developer_identity.cer is the file you download from the portal

Step 2:

openssl pkcs12 -nocerts -out APSCertificates.pem -in APSCertificates.p12

Where APSCertificates.p12 is a file you export from the Mac Keychain. This is critical, you must import the certificate from the portal into keychain. Find it in My Certificates, open the disclosure triangle and highlight both the certificate and the private key, then right click and export them. Give them a password and save them to a p12 file.

Step 3:

openssl pkcs12 -export -in aps_developer_identity.pem -out aps_developer_identity.p12 -inkey APSCertificates.pem

I have added the certificate and it isn't working, i'm not receiving the notification to the device. Does any one know how else i am supposed to create the certificate??

4

2 に答える 2

0

これを試して:

.cer ファイル (aps_development 証明書は ios_development ではありません) をダウンロードした後、次のコマンドで pem ファイルを管理します。

openssl x509 -in "path_to_apple_cert.cer" -inform DER -out "path_to_an_output_Cert.pem" -outform PEM

APSCertificates.p12 ファイルを取得して、2 番目のコマンドを実行します。

openssl pkcs12 -nocerts -in "path_to_exported_p12_from_apple_cer.p12" -out "path_to_an_output_Key.pem" -passin pass:your_p12_password -passout pass:your_new_p12_password

生成した 2 つの pem ファイルを取得して、次のコマンドを実行します。

openssl pkcs12 -export -inkey "path_to_an_output_Key.pem" -in "path_to_an_output_Cert.pem" -out "path_to_final_p12.p12" -passin pass:your_new_p12_password -passout pass:your_final_p12_password

これは、プッシュ通知用の P12 です。

を使用したくない場合

$ cat command PushChatCert.pem PushChatKey.pem > ck.pem

場合によっては含まれますが、Windows を使用している場合は、次を使用できます。

type PushChatCert.pem PushChatKey.pem > ck.pem
于 2015-01-30T02:00:44.310 に答える