`
larnsan
  • 浏览: 4588 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

java apns 推送消息到iphone设备

阅读更多

java代码比较简单,可是使用开源的类库 如https://github.com/notnoop/java-apns

估计卡住的人通常是和apns握手失败。这原因主要是java、.net和mac的ssl连接区别.

java需要把下载的文件再次转换才可以使用。

参考:

1、将aps_developer_identity.cer转换成 aps_developer_identity.pem格式。

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

2、将p12格式的私钥转换成pem,需要设置4次密码,这里密码都设置为:123456。

openssl pkcs12 -nocerts -out PushChat_Noenc.pem -in PushChat.p12

3、用certificate和the key 创建PKCS#12格式的文件。

openssl pkcs12 -export -in aps_developer_identity.pem -inkey PushChat_Noenc.pem -certfile PushChat.certSigningRequest -name "aps_developer_identity" -out aps_developer_identity.p12

这样我们就得到了在java、或者.net应用程序中使用的证书文件:aps_developer_identity.p12

openssl 命令可以直接在mac终端执行

分享到:
评论
3 楼 Mybeautiful 2012-07-10  
aps_developer_identity.cer苹果官网申请


其实我都没有申请开发者账号,可不可以别人发个给我? 比如一个应用的开发者,需要其他人帮忙,他只需要把自己的 aps_developer_identity.cer发给别人就行了?
2 楼 larnsan 2012-07-10  
aps_developer_identity.cer苹果官网申请
openssl可以独立安装 不一定要使用mac自带的
1 楼 Mybeautiful 2012-07-06  
您好,请问下,
aps_developer_identity.cer 从哪里搞来的?

另外openssl必须要mac吗?如果没有怎么办。。。

最后问下,
我可以不可以请别人在跟我生成一个 最终的aps_developer_identity.p12发给我, 就可以了? 还是一定要用我自己的开发者账号生成?

相关推荐

Global site tag (gtag.js) - Google Analytics