CDRouter Support

How do I display the contents of a SSL certificate?

knowledge-base version 10.4

You can display the contents of a PEM formatted certificate under Linux, using openssl:

$ openssl x509 -in acs.qacafe.com.pem -text

The output of the above command should look something like this:

cdrouter@linux:/usr/share/doc/cdrouter> openssl x509 -in acs.qacafe.com.pem -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            73:10:d8:99:cd:08:43:56:57:e0:56:17:84:87:8e:e3
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority
        Validity
            Not Before: Jun  9 00:00:00 2006 GMT
            Not After : Jun  9 23:59:59 2007 GMT
        Subject: C=US, ST=New Hampshire, L=Portsmouth, O=QA Cafe, OU=CDRouter, OU=Terms of use at www.verisign.com/rpa (c)05, CN=acs.qacafe.com
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (1024 bit)
                Modulus (1024 bit):
                    00:f7:03:cb:05:bb:4d:5b:78:e2:b7:1d:0c:24:f5:
                    3c:d6:fe:2f:b6:4c:e5:20:44:32:1b:a2:16:af:ec:
                    21:6a:b4:71:0d:84:e3:c3:f3:01:26:b9:65:79:1c:
                    dd:2c:e0:b8:16:4a:cf:50:63:b8:ce:a2:fb:39:8c:
                    73:45:d2:1d:30:45:9c:10:35:65:63:ed:4c:b6:61:
                    06:2b:e9:85:b5:9f:ea:84:08:2f:19:d5:03:eb:c3:
                    47:10:41:1f:ab:c6:d7:8a:ea:65:52:b7:d8:1e:2e:
                    d0:4c:92:78:16:ba:45:ef:b4:dd:64:35:36:2e:25:
                    de:15:00:55:e5:c7:fa:bd:01
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Digital Signature, Key Encipherment
            X509v3 CRL Distribution Points:
                URI:http://SVRSecure-crl.verisign.com/SVRSecure.crl

            X509v3 Certificate Policies:
                Policy: 2.16.840.1.113733.1.7.23.3
                  CPS: https://www.verisign.com/rpa

            X509v3 Extended Key Usage:
                TLS Web Server Authentication, TLS Web Client Authentication
            Authority Information Access:
                OCSP - URI:http://ocsp.verisign.com

            1.3.6.1.5.5.7.1.12:
                0_.].[0Y0W0U..image/gif0!0.0...+..............k...j.H.,{..0%.#http://logo.verisign.com/vslogo.gif
    Signature Algorithm: sha1WithRSAEncryption
        4f:4a:b6:44:62:e1:96:57:6a:c1:b4:07:75:70:57:1d:7f:d6:
        02:ee:9b:3a:d4:a0:21:72:51:f9:99:05:22:93:be:7d:59:3a:
        f3:1f:90:5a:f1:92:b9:4b:21:ce:a0:c1:3f:80:96:ec:e9:cf:
        15:ee:92:6c:57:c7:b6:2b:71:ad:eb:3a:63:17:83:07:f8:26:
        ef:36:f2:d1:d4:92:92:b0:35:01:d2:6b:8c:41:d2:03:f0:32:
        f4:af:cf:ca:6f:f9:35:a1:97:56:0c:2f:4d:4e:51:1d:2a:ca:
        da:fe:bc:8a:1b:17:6c:d0:f2:2f:68:c5:dc:1b:04:dd:6d
-----BEGIN CERTIFICATE-----
MIID+DCCA2WgAwIBAgIQcxDYmc0IQ1ZX4FYXhIeO4zANBgkqhkiG9w0BAQUFADBf
MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXUlNBIERhdGEgU2VjdXJpdHksIEluYy4x
LjAsBgNVBAsTJVNlY3VyZSBTZXJ2ZXIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
HhcNMDYwNjA5MDAwMDAwWhcNMDcwNjA5MjM1OTU5WjCBrTELMAkGA1UEBhMCVVMx
FjAUBgNVBAgTDU5ldyBIYW1wc2hpcmUxEzARBgNVBAcUClBvcnRzbW91dGgxEDAO
BgNVBAoUB1FBIENhZmUxETAPBgNVBAsUCENEUm91dGVyMTMwMQYDVQQLFCpUZXJt
cyBvZiB1c2UgYXQgd3d3LnZlcmlzaWduLmNvbS9ycGEgKGMpMDUxFzAVBgNVBAMU
DmFjcy5xYWNhZmUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD3A8sF
u01beOK3HQwk9TzW/i+2TOUgRDIbohav7CFqtHENhOPD8wEmuWV5HN0s4LgWSs9Q
Y7jOovs5jHNF0h0wRZwQNWVj7Uy2YQYr6YW1n+qECC8Z1QPrw0cQQR+rxteK6mVS
t9geLtBMkngWukXvtN1kNTYuJd4VAFXlx/q9AQIDAQABo4IBaDCCAWQwCQYDVR0T
BAIwADALBgNVHQ8EBAMCBaAwQAYDVR0fBDkwNzA1oDOgMYYvaHR0cDovL1NWUlNl
Y3VyZS1jcmwudmVyaXNpZ24uY29tL1NWUlNlY3VyZS5jcmwwRAYDVR0gBD0wOzA5
BgtghkgBhvhFAQcXAzAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy52ZXJpc2ln
bi5jb20vcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjA0BggrBgEF
BQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLnZlcmlzaWduLmNvbTBt
BggrBgEFBQcBDARhMF+hXaBbMFkwVzBVFglpbWFnZS9naWYwITAfMAcGBSsOAwIa
BBSP5dMahqyNjmvDz4Bq1EgYLHsZLjAlFiNodHRwOi8vbG9nby52ZXJpc2lnbi5j
b20vdnNsb2dvLmdpZjANBgkqhkiG9w0BAQUFAAN+AE9KtkRi4ZZXasG0B3VwVx1/
1gLumzrUoCFyUfmZBSKTvn1ZOvMfkFrxkrlLIc6gwT+AluzpzxXukmxXx7Yrca3r
OmMXgwf4Ju828tHUkpKwNQHSa4xB0gPwMvSvz8pv+TWhl1YML01OUR0qytr+vIob
F2zQ8i9oxdwbBN1t
-----END CERTIFICATE-----

Likewise, you can display the contents of a DER formatted certificate using this command:

$ openssl x509 -in MYCERT.der -inform der -text

Contents

×

About CDRouter

CDRouter is made by QA Cafe, a technology company based in Portsmouth, NH.

Get in touch via our Contact page or by following us on your favorite service: