26

我已经有一个development certificate in apple developer portal. 我正在开发一个 iPhone 应用程序,我想在这个应用程序中集成 Apple 推送通知。我创建了一个new App ID使用现有证书和enabled the Push Notification in this app id. 我创建了一个new Provisioning Profile使用新创建的应用程序 ID。在这些步骤之前,我已经创建并下载了.cer file from keychain access. 完成这些步骤后created SSL (Apple Push Notification Service SSL certificate) file and installed,我在我的 Mac 钥匙串访问中下载了新的。一旦我安装了这个文件,验证(那里有绿色勾号)和got the .p12 file from this ssl file.

我按照苹果文档RemoteNotificationsPG.pdf,在保存 .p12 文件后他们提到的这个文档中打开终端应用程序并输入以下推荐,

openssl pkcs12 -in Certificates.p12 -out Certificates.pem -nodes

我在我的终端应用程序中使用了它,但出现了错误消息,即

Error opening input file Certificates.p12
Certificates.p12: No such file or directory

您能否建议或指导我在哪里做错或在这些步骤中遗漏了什么?请帮我。提前致谢。

编辑:

我将我的 Certificates.p12 文件存储在我的桌面上。文件夹路径是Desktop->1/5/2012_Certificate->2/5/12->Certificates.p12

'ls' command在终端中使用过它没有列出我的 Certificates.p12 文件。

我已经输入cd *path*了这个返回No such file or directory

请帮我。提前致谢。

4

2 回答 2

8

您在正确的目录中吗?使用 ls 命令,它是否列出 Certificates.p12?

编辑:在终端类型中:

ls

这将列出您所在当前目录的所有文件。如果未列出 Certificates.p12,则说明您不在终端的正确目录中。

要获得正确的目录类型:

cd *path*

其中 path 是包含 Certificates.p12 的文件夹。您可以在键入 cd 后将该文件夹拖放到终端中。击回。然后运行 ​​openssl 命令。

于 2012-05-02T06:45:59.810 回答
3

打开终端,点击ls列出当前目录下的项目,

然后,如果您不在 .p12 移动到正确目录的文件夹中

cd directory path

例如,

cd Downloads

然后列出使用的文件并确保 .p12 文件存在于目录中。

然后使用以下命令将 .p12 文件转换为 .pem 文件。

openssl pkcs12 -in filename.p12 -out filename.pem -nodes

您创建的 .pem 文件将保存在具有 .p12 文件的目录中。

于 2020-07-27T18:04:35.173 回答