Skip to content

Instantly share code, notes, and snippets.

@sehrgut
Last active May 22, 2016 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sehrgut/ed06ef594a05a95275fc to your computer and use it in GitHub Desktop.
Save sehrgut/ed06ef594a05a95275fc to your computer and use it in GitHub Desktop.
show signing certs available in keychain
#!/bin/bash
XSPLIT=~/bin/xsplit
pass=`dd if=/dev/random bs=1 count=256 2>/dev/null | openssl sha1`
(
sudo security export -k "/Library/Keychains/System.keychain" \
-P "$pass" -t identities -f pkcs12 2>/dev/null
security export -k "$HOME/Library/Keychains/login.keychain" \
-P "$pass" -t identities -f pkcs12
) | \
openssl pkcs12 -nokeys -passin "pass:${pass}" 2>/dev/null | \
$XSPLIT -R '^-+END CERTIFICATE-+$' openssl x509 \
-noout -fingerprint -subject -issuer -dates -alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment