Skip to content

Instantly share code, notes, and snippets.

@joncardasis
Created August 10, 2017 19:55
Show Gist options
  • Select an option

  • Save joncardasis/c99e8467492e5dc7c279cc09e2aa3adb to your computer and use it in GitHub Desktop.

Select an option

Save joncardasis/c99e8467492e5dc7c279cc09e2aa3adb to your computer and use it in GitHub Desktop.
Obtain Public Key from iOS .mobileprovision profile
  1. Install homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
  1. Install XMLStarlet for xml parsing:
brew install xmlstarlet
  1. Export public key from the .mobileprovision with the help of OpenSSL:
security cms -D -i embedded.mobileprovision | xml sel -t -v "/plist/dict/key[. = 'DeveloperCertificates']/following-sibling::array[1]/data[1]" | awk '{print $1}' | sed '/^$/d' | base64 -D | openssl x509 -inform der > publickey.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment