"Java/c# Server" IOS configuration push certificate P12 file flow

Source: Internet
Author: User
Tags openssl x509 pkcs12

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.