Last active
May 22, 2016 22:51
-
-
Save sehrgut/ed06ef594a05a95275fc to your computer and use it in GitHub Desktop.
show signing certs available in keychain
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/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