Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active March 8, 2016 16:48
Show Gist options
  • Save dwallraff/5e5a6ac30c6755200059 to your computer and use it in GitHub Desktop.
Save dwallraff/5e5a6ac30c6755200059 to your computer and use it in GitHub Desktop.
Get CNs from all certs in a manifest
sed -n -e '/BEGIN CERTIFICATE/,/END CERTIFICATE/ p' <file> | sed -e 's/^ *//g' | sed -e 's/-----END CERTIFICATE-----/-----END CERTIFICATE-----,./' | tr , '\n' | while read -d $'.' var; do echo "$var" | openssl x509 -text -noout; done | grep "Subject:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment