Skip to content

Instantly share code, notes, and snippets.

@dreness
Last active October 9, 2022 17:08
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dreness/6384ebf7576092742232820e541f27a2 to your computer and use it in GitHub Desktop.
A hopefully stable listing of identities, keys, and certs found in keychain
#!/bin/bash
function sep { printf -- '-%.0s' {1..80}; echo ''; }
sep ; echo "Identities" ; sep
security find-identity
echo ''
sep ; echo "Keys" ; sep
security dump-keychain \
| egrep -A 3 'class: (0x0000000F|0x00000010|0x00000011)' \
| sed -E 's/class: (0x0000000F|0x00000010|0x00000011)/class: key/g'
echo ''
sep ; echo "Certs" ; sep
security dump-keychain \
| egrep -A 2 'class: (0x80001000)' \
| sed -E 's/class: 0x80001000/class: cert/g'
echo ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment