43

I have a certificate and/or private key file (pfx) on my OS X desktop. I'd like to look at its information (CN, SAN, OU, thumbprint, etc) but when I double click on it, it attempts to install into my Keychain. Once its in there, I can see the info and then delete it.

I would like to know if there is a way to "open" a certificate for viewing without having to install it into your Keychain. Similar to how you can click on the padlock in Safari and see the cert info.

I'd prefer something native to OS X but maybe there are tools out there too?

5 Answers 5

55

I'm not sure if this was available in the OS you had at the time you wrote your question, but at least with OS X 10.11.6, if you select the .crt file in the Finder and press the spacebar, a Quick Look window will open and you can see all of that info in a nice display. Works for .pfx files too.

4
  • 2
    This is actually a very useful method! I like it more than the command line version! Thanks! Feb 20, 2017 at 16:01
  • 1
    Thanks for posting this - I've rediscovered this hint twice now. Why is this MacOS feature so hard to remember!
    – sherb
    Jun 24, 2020 at 18:37
  • 1
    Note: Quick Look doesn't seem to work for certificates secured with passphrases (at least for *.pfx files). Importing it to my keychain and inspecting it there did the trick.
    – Gerrit-K
    Mar 4, 2021 at 9:24
  • 2
    Thanks, this works for .cer files too Mar 24, 2021 at 5:43
22

via Terminal.app and type something like:

openssl x509 -noout -text -in ~/Desktop/yourcertificate.crt  

Where last parameter is a path your certificate file(you can drag and drop that if you like)

gives us:

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 27 (0x1b)
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, O=Apple Inc., OU=Apple Certification Authority, CN=Apple Root CA
        Validity
            Not Before: May 26 19:16:09 2010 GMT
            Not After : Jul 26 19:16:09 2017 GMT
        Subject: C=US, O=Apple Inc., OU=Apple Certification Authority, CN=Apple Application Integration Certification Authority
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
......
1
  • 1
    Yea, I thought about openssl... I was hoping to have it be more gui based. Probably could write an Automator script to be able drag/drop the cert into a folder and it would pop open a terminal and run the openssl command you suggested. thanks. Jan 9, 2015 at 6:24
10

in addition to Krishen approved answer above about selecting the certificate (.cer, .pem, others) in finder and hitting 'space', you can also right click and select Quick Look . I just tested it on 10.14.1 (Mojave), so this definitely works on current OSX

selecting quick-look for a certificate in finder

4

You can also use KeyStore Explorer, an application to view/create/edit certificate and trust stores, and conversion between them. It's really powerful but might be too much for you.

certificate

distinguished name

2
  • it is JAVA based, need JRE, please not on Mac
    – János
    Jan 31, 2020 at 9:48
  • @János It provides binary with built-in JRE (the dmg version), if you don’t want to install JRE yourself. Feb 1, 2020 at 5:14
0

RENAME to .txt All the best ;)

1
  • That gives you either some Base64 mess or binary. OP wanted to view the information. Some texts might leak in the binary at best, but you need to guess what they stand for. Jul 31, 2021 at 0:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .