如何在 Windows 服务器上安装 Apple Push 证书 [英] How to install Apple Push certificate on Windows server

查看:38
本文介绍了如何在 Windows 服务器上安装 Apple Push 证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装从苹果开发门户下载的证书,以便在我的 Windows 服务器上测试推送通知.我在网上搜索了一个解决方案,但每个人对此都有不同的看法,有没有人有关于如何执行此操作的分步指南?

I need to install the certificate I've downloaded from apple dev portal in order to test the push notification on my Windows server. I searched online a solution but everyone says different things about it, Does anyone has a step by step guide on how to do this?

推荐答案

我也一直在研究这个主题.以下链接可能对您有用:

I have also been researching this subject. The following links may be useful to you:

http://loudsoftware.com/?p=186

https://arashnorouzi.wordpress.com/2011/04/01/sending-apple-push-notifications-in-asp-net-%e2%80%93-part-2-生成-apns-证书/

我最终通过遵循我设法摆脱上述链接的这些关键点来完成这项工作.假设您已经按照标准苹果推送"说明创建了苹果推送证书和私钥.

I finally got this working by following these key points that I managed to get out of those links above. It assumes that you have already created the Apple Push certificates and private keys following "standard apple push" instructions.

在您的 Mac 计算机上,按如下方式生成您的证书(归功于 arashnorouzi):

使用 open ssl 创建一个 PKCS12 格式的文件,您将需要您的开发者私钥(可以从钥匙串中导出)和 CertificateSigningRequest??.certSigningRequest

Create a PKCS12 format file using open ssl, you will need your developer private key (which can be exported from the keychain) and the CertificateSigningRequest??.certSigningRequest

  1. 将 apn_developer_identity.cer(der 格式)转换为 pem:

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

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

  1. 接下来,将 p12 私钥转换为 pem(需要输入至少 4 个字符的密码):

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

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

  1. (可选):如果您想从私钥中删除密码:

openssl rsa -out private_key_noenc.pem -in private_key.pem

openssl rsa -out private_key_noenc.pem -in private_key.pem

  1. 获取证书和密钥(带或不带密码)并创建一个 PKCS#12 格式的文件:

openssl pkcs12 -export -in apn_developer_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest??.certSigningRequest -name apn_developer_identity" -out apn_developer_identity.p12

openssl pkcs12 -export -in apn_developer_identity.pem -inkey private_key_noenc.pem -certfile CertificateSigningRequest??.certSigningRequest -name "apn_developer_identity" -out apn_developer_identity.p12

现在,在您的 Windows Server 上执行以下操作(归功于 Loudsoftware 的账单):

  • 将上面的.p12文件复制到windows服务器
  • 打开mmc.exe,将.p12文件导入console root -> Certificates(Local Machine)"证书,并在Personal"下文件
  • 为证书添加权限

详细说明:

  • 转到开始">运行"
  • 输入 mmc 并按 Enter
  • 点击文件 > 添加/删除管理单元
  • 选择证书管理单元并点击添加
  • 选择计算机帐户"选项,然后单击下一步"
  • 选择本地计算机选项并单击完成
  • 点击确定
  • 展开证书 > 个人并选择证书文件夹
  • 右键单击 Apple 推送通知服务 - 客户端证书,然后选择所有任务 > 管理私钥
  • 在证书属性的安全"选项卡上,单击添加"
  • 键入 Authenticated Users 并单击检查名称,然后单击确定"
  • 选中允许列下的读取复选框
  • 点击应用然后确定

这篇关于如何在 Windows 服务器上安装 Apple Push 证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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