卡住为 MoonAPNS 创建 p12 文件 [英] Stuck creating p12 file for MoonAPNS

查看:22
本文介绍了卡住为 MoonAPNS 创建 p12 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建 .p12 证书时遇到了一些问题.我之前创建了一个带有推送通知的应用程序,这很好用.该应用程序获取用户设备 ID 并将其保存到数据库中.

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.

我已经下载了我需要的相关文件,然后我知道我需要使用 ssl 才能创建我的新的和组合的 p12.我一辈子都记不起我是如何创建 p.12 文件的.

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.

我正在使用 Moonapns.

I'm using moonapns.

我使用了以下内容:

第 1 步:

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

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

其中 aps_developer_identity.cer 是您从传送门

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

第 2 步:

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

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

其中 APSCertificates.p12 是您从 Mac Keychain 导出的文件.这很关键,您必须将证书从门户导入到钥匙链.在我的证书中找到它,打开披露三角形并突出显示证书和私钥,然后右键单击并导出它们.给他们一个密码并将它们保存到一个 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.

第 3 步:

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

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??

推荐答案

试试这个:

下载.cer文件后(aps_development证书不是ios_development),使用如下命令管理pem文件:

After downloading the .cer file (aps_development certificate is not the ios_development), manages the pem file with the following command:

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

获取您的 APSCertificates.p12 文件并运行第二个命令:

Take your APSCertificates.p12 file and run the second command:

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

现在获取您生成的两个 pem 文件并运行以下命令:

Now take the two pem files that you generated and run the following command:

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.

This is your P12 for push notifications.

如果你不想使用

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

在某些情况下包含,如果您使用的是 Windows,则可以使用:

contained in some instances, if you are on windows you can use:

type PushChatCert.pem PushChatKey.pem > ck.pem

这篇关于卡住为 MoonAPNS 创建 p12 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆