iOS 证书 cer转换为pem

来源:互联网 发布:怎么做网络水军 编辑:程序博客网 时间:2024/04/28 01:28

今天公司项目做推送服务器需要把cer文件转换成pem文件使用。搜索下网络。找到一篇不错的博文,链接我会放到,参考文章上去。

大致是需要三步转换:

1.openssl x509 -in aps_production.cer -inform DER -out aps_production_identity.pem -outform PEM

2.openssl pkcs12 -nocerts -out PushChatKey.pem -in PushChat.p12

3. cat aps_production_identity.pem PushChatKey.pem > ck.pem

这里需要有个前提,就是你已经活得了文件aps_production.cer、PushChat.p12。
接下来说下PushChat.p12文件的获得:
附上两张截图,这里假设你在申请推送的时候获得的密钥是push.csr
iOS 证书 cer转换为pem - AA - 小老虎的博客
 
iOS 证书 cer转换为pem - AA - 小老虎的博客
 
iOS 证书 cer转换为pem - AA - 小老虎的博客
 
iOS 证书 cer转换为pem - AA - 小老虎的博客
 至于aps_production.cer文件,这个文件是我们在需要推送服务的APP里边最终获得的一个文件,我就不再列举了,网上教程实在是多。
两个文件获得完了之后,我们就可以按照上边的步骤生成pem文件。发送给服务器就行了。
提醒大家注意:在生成pem文件最好是先测试一下,cer文件是不是需要的,以免生成错误的pem文件。
验证生成的pem是否正确:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert PushChatCert.pem -key PushChatKey.pem颜色部分换成自己的cer文件和key文件
附上两个参考链接:
http://www.cnblogs.com/qq78292959/archive/2012/07/16/2593651.html
对推送介绍比较详细
转换pem的博文链接:
http://blog.csdn.net/silencetq/article/details/8115501

 

 

0 0
原创粉丝点击