Skip to content

Instantly share code, notes, and snippets.

@command-tab
command-tab / gist:2370710
Created April 12, 2012 20:17
Extract Certificate Subject from a Provisioning Profile
# Parse a provisioning profile
# Extract the first DeveloperCertificates <data> entry
# Remove any leading whitespace
# Remove any blank lines
# Base64 decode the blob
# Parse the .cer with OpenSSL
# Extract the first line, which is the certificate subject (the rest is the cert blob)
# End up with a string like: subject= /UID=AABBCCDDEE/CN=iPhone Developer: First Last (FFGGHHIIJJ)/C=US
# Note: Uses xmlstarlet to parse the plist, but you could probably use PlistBuddy or grep, too