Created
March 21, 2012 14:18
-
-
Save neonichu/2147247 to your computer and use it in GitHub Desktop.
Extract the subject of the signing certificate of a .mobileprovision file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Extract the subject of the signing certificate of a .mobileprovision file | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 [mobileprovision-file]" | |
exit 1 | |
fi | |
end=`grep -n --binary-files=text '</plist>' "$1"|cut -d: -f-1` | |
sed -n "2,${end}p" "$1"|xpath '//data' 2>/dev/null|sed -e '1d' -e '$d'|base64 -D| \ | |
openssl x509 -subject -inform der|head -n 1 |
Ok, i got "notAfter=Jul 9 06:53:40 2017 GMT".
Is that looks like a normal output ?! what is it ?
You can extract the plist cleanly using openssl
nowadays:
openssl smime -inform der -verify -noverify -in file.mobileprovision
https://stackoverflow.com/a/14379814/252627
Can be useful if you are trying to work with the file and data on Windows for example where all the others things are a lot harder to use or don't exist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
security cms -D -i path_to_mobileprovision > tmp.plist && /usr/libexec/PlistBuddy -c 'Print :Entitlements:application-identifier' tmp.plist