Before configuring the P12 certificate file, we want to prepare three files
1. pushchat.certsigningrequest Request certificate file
2. After PUSHCHATKEY.P12 request the certificate file, a public and private key is generated in the certificate key, and the P12 file exported through the private key
3. Aps_developer_identity.cer using the request certificate file to generate the push certificate
Get to the devicetoken that we can submit to. NET applications through the WebService service, where I simply process it, print it directly, and copy it to a. NET application environment.
A. NET application that sends a notification needs to know Devicetoken, and requires a certificate that is connected to the APNs.
This certificate can be obtained from the two files we generated earlier.
Specific configuration actions:
Using OpenSSL
1. Convert Aps_developer_identity.cer to APS_DEVELOPER_IDENTITY.PEM format.
OpenSSL x509-in aps_developer_identity.cer-inform der-out aps_developer_identity.pem-outform PEM
2, the P12 format of the private key conversion to PEM, you need to set 4 times the password, the password is set to: abc123.
OpenSSL pkcs12-nocerts-out pushchat_noenc.pem-in PUSHCHATKEY.P12
3. Create pkcs#12 format files with certificate and the key.
OpenSSL pkcs12-export-in aps_developer_identity.pem-inkey pushchat_noenc.pem-certfile PushChat.certSigningRequest- Name "Aps_developer_identity"-out aps_developer_identity.p12
This way we get the certificate file used in the. NET application: APS_DEVELOPER_IDENTITY.P12.
Send notifications in a. NET application.
There is an open-source class library: Apns-sharp.
The address is: http://code.google.com/p/apns-sharp/.
We download the source code, the inside of the JdSoft.Apple.Apns.Notifications to make corresponding adjustments can be used.
We make corresponding adjustments to JdSoft.Apple.Apns.Notifications.Test according to Devicetoken and P12file, such as.
This will be OK.