I’m attempting to write a script to keep an eye on my battery of signing credentials for a build server I’m running. I’m almost positive I can accomplish this in a bash script using security(1), but I can’t find any examples on how to find expiration information of installed identities in a given keychain (everything looks encrypted).
Has anyone done something similar that might be able to help me get these dates?
If you use the
find-certificatecommand line option with security(1), you can output the certificate in PEM format with-p.From there, use
openssl x509 -textto output the fields from the certificate. Reference You should be able to play with options and text output to get the data you need from there.