Find UUIDs of provisioning profiles in current directory:
find . -name '*.mobileprovision' -print0 | xargs -0 -t -n 1 security cms -D -i | grep -A1 UUID 2>&1
Convert .mobileprovision to .plist
security cms -D -i foo.mobileprovision -o foo.plist
Extract signing certificate from provisioning profile plist
/usr/libexec/PlistBuddy foo.plist -c 'Print DeveloperCertificates:0' > foo.cer
List available valid codesigning certificates
security find-identity -v -p codesigning
Get SHA1 fingerprint of certificate
openssl x509 -in foo.cer -inform der -noout -fingerprint
Get full details of certificate
openssl x509 -in foo.cer -inform der -noout -text
codesign -d -v foo.app
Extract signing certificates from app
codesign -d --extract-certificates=./foocert foo.app # Extracts to ./foocert0, ./foocert1 etc.
Extract entitlements from app
codesign -d --entitlements :fooentitlements.plist foo.app
Find location of xcrun tools
xcrun -sdk iphoneos -f PackageApplication