net发送apns解决方案(iphone push)

原文链接 net发送apns解决方案(iphone push)

 

到现在为止,我们已经生成了3个文件。

1、PushChat.certSigningRequest

2、PushChat.p12

3、aps_developer_identity.cer




从客户端得的deviceToken。

发送通知的.net应用程序出来需要知道deviceToken之外,还需要一个与APNS连接的证书。

这个证书可以通过我们前面生成的两个文件中得到。

使用OpenSSL生成.net和APNS通信的证书文件。

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

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

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

openssl pkcs12 -nocerts -out PushChat_Noenc.pem -inPushChat.p12

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

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

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

net的生成证书就是这个样子。其他程序的方式会不一样。

猜你喜欢

转载自notejs.iteye.com/blog/2039003