title: MDM:How to use APNS certificate
body: <p>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 <a href="https://identity.apple.com/pushcert/">https://identity.apple.com/pushcert/</a></p>
  
  <p>I have referred the 2011_THE iOS MDM Protocol document for MDM server implementation.I am able to get the pushmagic and device token.</p>
  
  <p>I am using the below code which is given in the "2011_THE iOS MDM Protocol" document as server.py file.</p>
  
  <pre><code>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()
  </code></pre>
  
  <p><strong>Now I want to know should I use the APNS certificate downloaded from portal <a href="https://identity.apple.com/pushcert/">https://identity.apple.com/pushcert/</a> by renaming it to "PlainCert.pem" in our server.py code or should I generate "PlainCert.pem" by some other way?</strong></p>