4
votes

I have received the APNS certificate using iOS Enterprise developer account and that is in .pem format.We have download this mdm certificate from the portal https://identity.apple.com/pushcert/

I have referred the 2011_THE iOS MDM Protocol document for MDM server implementation.I am able to get the pushmagic and device token.

I am using the below code which is given in the "2011_THE iOS MDM Protocol" document as server.py file.

class queue_cmd: def GET(self):
global current_command, last_sent global my_DeviceToken, my_PushMagic 
i = web.input() cmd = i.command
cmd_data = mdm_commands[cmd] 
cmd_data['CommandUUID'] = str(uuid.uuid4()) 
current_command = cmd_data last_sent = pprint.pformat(current_command)
wrapper = APNSNotificationWrapper('PlainCert.pem', False) 
message = APNSNotification() 
message.token(my_DeviceToken) 
message.appendProperty(APNSProperty('mdm', my_PushMagic))   
wrapper.append(message)
wrapper.notify()

Now I want to know should I use the APNS certificate downloaded from portal https://identity.apple.com/pushcert/ by renaming it to "PlainCert.pem" in our server.py code or should I generate "PlainCert.pem" by some other way?

2

2 Answers

3
votes

Follow this link also: http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning

and remove the passphrase from customerPrivateKey.pem using this command

openssl rsa -in customerPrivateKey.pem -out PlainKey.pem

Then merge your APNS certificate (for example CustomerCompanyName.pem) downloaded from the portal https://identity.apple.com/pushcert/ using this command

cat CustomerCompanyName.pem PlainKey.pem > PlainCert.pem

Now this PlainCert.pem file can be used in your server code.

1
votes

here's a document that should help

https://media.blackhat.com/bh-us-11/Schuetz/BH_US_11_Schuetz_InsideAppleMDM_WP.pdf

The APNS cert downloaded from apple should contain the public key portion of your certificate. you'll need to combine it with the private key to make a complete .p12 pem file. this should be the PlainCert.pem that the code is talking about.