summaryrefslogtreecommitdiffstats
path: root/README.md
blob: d62bbcdc5b93038f0c01218aa179881e9b9417b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# SSL Decoder

Simple PHP script which decodes an SSL connection and/or certificate and displays information.

* Tries to give all the information you need instead of a rating. 
* Open source, so you can self host it. 
* Shows the entire certificate chain. 
* Allows to paste a CRL/Cert
* Validates the certificate, chain, CRL and OCSP (of every cert in the chain)
* Has easy copy-pastable PEM versions of certs
* Ciphersuite enumeration as an option.
* JSON API
* Fast.

### Features

- Connection information
- Decodes CSR
- Decodes Certificates
- Decodes SSL Connections
- SSL Protocol version tester
- OCSP validation
- OCSP Stapling
- HSTS & HPKP headers
- SPKI hash
- Public Key PEM
- Certificate PEM
- CRL validation
- Full certificate chain validation.
- Issuer validation
- Date validation
- JSON API
- Warnings for bad connection settings or certificate options

### Requirements

- PHP 5.6+
- OpenSSL
- PHP must allow shell_exec and remote fopen.
- Debian: `php-intl` package installed.

### Installation

Unpack and go!

    cd /var/www
    git clone https://github.com/RaymiiOrg/ssl-decoder.git
    chown $wwwuser ssl-decoder/results/

Browse to https://your-server/ssl-decoder.

### Demo

See [https://tls.so](https://tls.so).

<a href="https://tls.so"><img src="http://i.imgur.com/R1BQlLVm.png" /></a>

### License

GNU Affero GPL v3: [https://www.gnu.org/licenses/agpl-3.0.html](https://www.gnu.org/licenses/agpl-3.0.html)


### Tracking

The SSL Decoder includes Piwik Javascript tracking code. If you self host it, you might want to remove that. It is in `inc/footer.php`.

### JSON API

Endpoint: `/json.php`. 



Accepts: 
- CSR 
- Certificate 
- Host (+port, default 443)

Returns JSON UTF-8 encoded certificate (and connection) data. 

Add `type=pretty` as parameter to get a pretty printed JSON (text/html). Otherwise just JSON (application/json).

Examples:

#### CSR

Params:

    - `csr` = PEM encoded certificate request

Example Request:

    json.php?csr=-----BEGIN+CERTIFICATE+REQUEST-----+%0D%0AMIIG8zCCBpgCAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx+%0D%0AITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCBkgwggQ6BgcqhkjO+%0D%0AOAQBMIIELQKCAgEA5KY342mozvKAAICT4EXDMfnDw7HkribKi8vMy%2BHQXJ%2FhAoNs+%0D%0AByxZygZVc48Q0FA1wMcFC20RtdswMCuogBlUcNxmOCZe%2FmYIJxfp6EWi6ZG0vTA5+%0D%0An6a89iEnfgZ9s2xnhO%2FXiHFax8cjHujQPH3epAtVsBPoxIHsWtVZv%2Fp08L6xgSHl%0D%0AwCQB00fuAhWu60oF45vsQwD%2FvPtQnYFD2elDWivcz51YT8c9EyiXb6geHhGSJkAY%0D%0AVEXNPV7%2FMrAF9ufhc9ss9vrxRiAvBEW2KToL8%2FcYa%2B1L0%2FVEGgJ8jkhhSfiN2q13%0D%0A%2FwBMgG%2FKPr5v94qjeuM4fl6LPZqOjhoYTJJL3WWiAiUzMez30hz%2BE1TUe5f9VI%2Ba%0D%0A1BH%2FhFvlDhuIEyIfsmupzKf0RpzXbSkP%2F4v3PlOuiuOEza1mbZZSOXBGOdKYYC7K%0D%0ALtVb62MD0B%2FFvD8yKO5NQCwFbQC60tU6JyneJJFdqY0HUjHERC3FMDoXoEH%2Fv8b5%0D%0A93kDg8jvmwijh96HgxkssoiRxYp9a9IL%2BGQ1WYYtVTSCz8zgWZyo0W0%2B3bJ66oAg%0D%0Al%2BfZw98xSa0SG1bd8k4c6xVgp%2Bou3EPorbXdgZg31HKrbiFVuhuJFvP3fRHw2GGM%0D%0A9oyFdAGuf1mdQU4XwqoEmhcRnIkN4IF8a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rdCVgnG%0D%0ACxWD4JC9okn%2F%2BnTSE5exLda%2FQ8BpXzKUuWSJaGYt1H1pRsUXsx0apZ2u%2FRyq6aI4%0D%0A2HwOKZN0%2FPV%2FoHQ8ayxu22dbfduY7YJ4zMkeovggR6tAoOKw4%2BxMMy82DKxpa%2Fkt%0D%0A5a%2B26Myf2dkzHH6ndgupjde%2FsZUifoJMib6i33DdT3TPwiJ1QvCK7cTlgO9CzeIZ%0D%0AssPBYC%2FfpV65Ih9wWJPaObDQPA5tt%2BtKTMOKwz9jmiaXFhmlGZtCahfll5xWXzVJ%0D%0AFbM6NxgYg0bErRcyck8Ngc5%2BO8fm3oGSotQ7eVh%2B%2B04J5g3vk9ufqbi02mFlpMZi%0D%0A%2FFykgQYbnCen%2BBxcO%2BboUMd4urqL0VpSu5NtBd8%2BqULWRrvBEf8s2IY3OaOQEvwJ%0D%0ANZhWJdNpg2lY%2BUmefxm9P9qQqfIhJ3LZavr3jfy81xVFqOciO1Xt7TfzVFqMGH1s%0D%0AaKyPCpApJQ%2BWPuM1WiAimGJFUgk5ZwHyqC8NFDA5wSr%2BfYR6NxZv3pFscb3PqxpQ%0D%0A6C%2BjnKYiyibu4indeE6gADALBglghkgBZQMEAwIDSAAwRQIgMvqOm1M55K0mNYL2%0D%0ArtHl2W%2F1zJufX7FlpAlR3UgoqdICIQDQoyoS8ND%2BjSUl1Pbn%2Buh6yzglP3vfvyxB%0D%0Ax1%2BT5MCUKw%3D%3D%0D%0A-----END+CERTIFICATE+REQUEST-----

Response

       {
        "data": {
            "chain": {
                "1": {
                    "subject": {
                        "C": "AU",
                        "ST": "Some-State",
                        "O": "Internet Widgits Pty Ltd"
                    },
                    "key": "-----BEGIN PUBLIC KEY-----\nMIIGS[...]LKJu7iKd14Tg==\n-----END PUBLIC KEY-----\n",
                    "details": {
                        "bits": "4096",
                        "key": "-----BEGIN PUBLIC KEY-----\nMIIGS[...]LKJu7iKd14Tg==\n-----END PUBLIC KEY-----\n",
                        "dsa": {
                            "p": "...",
                            "q": "...",
                            "pub_key": "..."
                        },
                        "type": "1"
                    }
                }
            }
        }
    }


#### Certificate 

Params:

    - `csr` = PEM encoded certificate

Example Request:

    json.php?csr=-----BEGIN+CERTIFICATE-----%0D%0AMIIKmDCCBoCgAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCTkwx%0D%0AFTATBgNVBAgMDFp1aWQgSG9sbGFuZDESMBAGA1UEBwwJUm90dGVyZGFtMRowGAYD%0D%0AVQQKDBFTcGFya2xpbmcgTmV0d29yazEVMBMGA1UECwwMU3BhcmtsaW5nIENBMRUw%0D%0AEwYDVQQDDAxTcGFya2xpbmcgQ0EwHhcNMTUwMzI5MTExMzU4WhcNMTcwMzI4MTEx%0D%0AMzU4WjBvMRMwEQYDVQQDDApnb29nbGUuY29tMRIwEAYDVQQIDAlSb3R0ZXJkYW0x%0D%0ACzAJBgNVBAYTAk5MMRowGAYDVQQKDBFTcGFya2xpbmcgTmV0d29yazEbMBkGA1UE%0D%0ACwwSU3BhcmtsaW5nIFdlYnNpdGVzMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC%0D%0ACgKCAgEAoi3dJz7UcdbIU%2BfM5S44tk8MM%2B%2BPguUDVnC2wviFgpg6Q%2BINGnAofUoe%0D%0Ay%2BCtiqNWZyey0QO9AglEX8Q0z3eTSTf29ntBgfMUwpMkkXuXDrdH78%2Fzh83L4VkO%0D%0Ar%2B87cRZi4clskcIE1DJrw%2FbN9oyRAjWdKZfpaMtLT9ab4yWNOCqy0gzxiG7NfAfv%0D%0AvqxF6Rwg9lNVJmRqwxP54qa2ayjmqVPhBgLqpRRfE2CPxxiCb8KdYhbFVaEraXKM%0D%0ARMFans%2BXSD6I5e0N3BTjAf2%2Bv6Dzjyt9sQFh%2FEpjqZrTe2JCwg3C44hy8RdohuN%2B%0D%0At0OsvAO46Xk7cP8Z%2FhqxSpcvNRhcjFQ6bCv74OXInVu5pSHydARSlM0FKfhAjaVl%0D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chain": {
                "1": {
                    "cert_data": {
                        "name": "/CN=google.com/ST=Rotterdam/C=NL/O=Sparkling Network/OU=Sparkling Websites",
                        "subject": {
                            "CN": "google.com",
                            "ST": "Rotterdam",
                            "C": "NL",
                            "O": "Sparkling Network",
                            "OU": "Sparkling Websites"
                        },
                        "hash": "ceef4183",
                        "issuer": {
                            "C": "NL",
                            "ST": "Zuid Holland",
                            "L": "Rotterdam",
                            "O": "Sparkling Network",
                            "OU": "Sparkling CA",
                            "CN": "Sparkling CA"
                        },
                        "version": "2",
                        "serialNumber": "3",
                        "validFrom": "150329111358Z",
                        "validTo": "170328111358Z",
                        "validFrom_time_t": "1427627638",
                        "validTo_time_t": "1490699638",
                        "extensions": {
                            "basicConstraints": "CA:TRUE",
                            "subjectKeyIdentifier": "AF:02:B6:2F:9D:07:8E:B8:D6:05:26:9F:4E:3C:5E:F3:EE:84:2B:34",
                            "authorityKeyIdentifier": "keyid:AC:89:58:64:1E:A8:6D:CC:3B:B9:38:4E:58:AE:A9:E7:CB:ED:DA:37\n",
                            "keyUsage": "Digital Signature, Key Encipherment",
                            "extendedKeyUsage": "TLS Web Server Authentication",
                            "crlDistributionPoints": "\nFull Name:\n  URI:http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl\n\nFull Name:\n  URI:http://crl.comodoca.com/COMODORSACertificationAuthority.crl\n\nFull Name:\n  URI:http://crl.pkioverheid.nl/RootLatestCRL-G2.crl\n\nFull Name:\n  URI:http://sr.symcb.com/sr.crl\n\nFull Name:\n  URI:http://crl.tcs.terena.org/TERENASSLCA.crl\n",
                            "subjectAltName": "DNS:*.google.nl, DNS:google.com, DNS:*.google.com, DNS:*.com, DNS:raymii.org, DNS:*.raymii.org",
                            "authorityInfoAccess": "CA Issuers - URI:http://crt.comodoca.com/COMODORSADomainValidationSecureServerCA.crt\nCA Issuers - URI:http://sr.symcb.com/sr.crt\nOCSP - URI:http://ocsp.comodoca.com\nOCSP - URI:http://ocsp.digidentity.eu/L4/services/ocsp\nOCSP - URI:http://sr.symcd.com\nOCSP - URI:http://ocsp.tcs.terena.org\n"
                        },
                        "purposes": {
                            "sslclient": {
                                "ca": "",
                                "general": ""
                            },
                            "sslserver": {
                                "ca": "",
                                "general": "1"
                            },
                            "nssslserver": {
                                "ca": "",
                                "general": "1"
                            },
                            "smimesign": {
                                "ca": "",
                                "general": ""
                            },
                            "smimeencrypt": {
                                "ca": "",
                                "general": ""
                            },
                            "crlsign": {
                                "ca": "",
                                "general": ""
                            },
                            "any": {
                                "ca": "1",
                                "general": "1"
                            },
                            "ocsphelper": {
                                "ca": "",
                                "general": "1"
                            },
                            "timestampsign": {
                                "ca": "",
                                "general": ""
                            }
                        }
                    },
                    "validation_type": "organisation",
                    "crl": {
                        "1": {
                            "crl_uri": "http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 30 00:56:21 2015 GMT\n",
                            "crl_next_update": "Apr  3 00:56:21 2015 GMT\n"
                        },
                        "2": {
                            "crl_uri": "http://crl.comodoca.com/COMODORSACertificationAuthority.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 29 19:04:22 2015 GMT\n",
                            "crl_next_update": "Apr  2 19:04:22 2015 GMT\n"
                        },
                        "3": {
                            "crl_uri": "http://crl.pkioverheid.nl/RootLatestCRL-G2.crl",
                            "status": "ok",
                            "crl_last_update": "Jan  8 10:19:45 2015 GMT\n",
                            "crl_next_update": "Jan  8 10:24:45 2016 GMT\n"
                        },
                        "4": {
                            "crl_uri": "http://sr.symcb.com/sr.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 30 09:01:05 2015 GMT\n",
                            "crl_next_update": "Apr  6 09:01:05 2015 GMT\n"
                        },
                        "5": {
                            "crl_uri": "http://crl.tcs.terena.org/TERENASSLCA.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 29 16:28:00 2015 GMT\n",
                            "crl_next_update": "Apr  2 16:28:00 2015 GMT\n"
                        }
                    },
                    "ocsp": "No OCSP URI found in certificate",
                    "hostname_in_san_or_cn": "n/a; ca signing certificate",
                    "serial": "3",
                    "key": {
                        "type": "rsa",
                        "bits": "4096",
                        "signature_algorithm": "sha1WithRSAEncryption",
                        "certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIK[...]Q7pn4iA==\n-----END CERTIFICATE-----\n",
                        "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMIIC[...]UCAwEAAQ==\n-----END PUBLIC KEY-----\n",
                        "spki_hash": "MQEUI8vhXsSgP7y58AWpE3xfqepYOHILKdHRewQSWkE="
                    }
                }
            }
        }
    }


#### Hostname + Port

Params:

    - `host` = Hostname or IP address
    - `port` = port to test (443, 993, 465, 8443 etc). 
    - ciphersuites = 1 to enumerate ciphersuites supported by the tested server. Takes longer. If not specified or not 1, ciphersuites will not be tested, used ciphersuite will be reported.


Port is optional and defaults to 443. Ciphersuites is optional and defaults to 0.

Example request:

    json.php?host=mijn.ing.nl&ciphersuites=1

Example response:

    {
        "data": {
            "connection": {
                "chain": {
                    "0": {
                        "name": "mijn.ing.nl",
                        "issuer": "Symantec Class 3 EV SSL CA - G3"
                    },
                    "1": {
                        "name": "Symantec Class 3 EV SSL CA - G3",
                        "issuer": "VeriSign Class 3 Public Primary Certification Authority - G5"
                    },
                    "validation": {
                        "status": "success"
                    }
                },
                "ip": "145.221.194.139",
                "hostname": "145.221.194.139",
                "port": "443",
                "protocols": {
                    "tlsv1.2": "1",
                    "tlsv1.1": "",
                    "tlsv1.0": "1",
                    "sslv3": ""
                },
                "supported_ciphersuites": [
                    "AES256-SHA256",
                    "AES256-SHA",
                    "AES128-SHA256",
                    "AES128-SHA",
                    "DES-CBC3-SHA"
                ],
                "tls_fallback_scsv": "unsupported",
                "strict_transport_security": "max-age=31622400",
                "public_key_pins": "not set",
                "ocsp_stapling": "not set",
                "openssl_version": "OpenSSL 1.0.2a 19 Mar 2015\n",
                "datetime_rfc2822": "Mon, 30 Mar 2015 12:18:11 +0200\n"
            },
            "chain": {
                "1": {
                    "cert_data": {
                        "name": "/jurisdictionC=NL/businessCategory=Private Organization/serialNumber=33031431/C=NL/postalCode=1102 MG/ST=Noord-Holland/L=Amsterdam Zuidoost/street=Bijlmerplein 888/O=ING BANK N.V./OU=Retail/CN=mijn.ing.nl",
                        "subject": {
                            "jurisdictionC": "NL",
                            "businessCategory": "Private Organization",
                            "serialNumber": "33031431",
                            "C": "NL",
                            "postalCode": "1102 MG",
                            "ST": "Noord-Holland",
                            "L": "Amsterdam Zuidoost",
                            "street": "Bijlmerplein 888",
                            "O": "ING BANK N.V.",
                            "OU": "Retail",
                            "CN": "mijn.ing.nl"
                        },
                        "hash": "0ede29ea",
                        "issuer": {
                            "C": "US",
                            "O": "Symantec Corporation",
                            "OU": "Symantec Trust Network",
                            "CN": "Symantec Class 3 EV SSL CA - G3"
                        },
                        "version": "2",
                        "serialNumber": "58839941462596964668433973121388685875",
                        "validFrom": "140918000000Z",
                        "validTo": "161029235959Z",
                        "validFrom_time_t": "1410998400",
                        "validTo_time_t": "1477785599",
                        "extensions": {
                            "subjectAltName": "DNS:mijn.ing.nl",
                            "basicConstraints": "CA:FALSE",
                            "keyUsage": "Digital Signature, Key Encipherment",
                            "extendedKeyUsage": "TLS Web Server Authentication, TLS Web Client Authentication",
                            "certificatePolicies": "Policy: 2.16.840.1.113733.1.7.23.6\n  CPS: https://d.symcb.com/cps\n  User Notice:\n    Explicit Text: https://d.symcb.com/rpa\n",
                            "authorityKeyIdentifier": "keyid:01:59:AB:E7:DD:3A:0B:59:A6:64:63:D6:CF:20:07:57:D5:91:E7:6A\n",
                            "crlDistributionPoints": "\nFull Name:\n  URI:http://sr.symcb.com/sr.crl\n",
                            "authorityInfoAccess": "OCSP - URI:http://sr.symcd.com\nCA Issuers - URI:http://sr.symcb.com/sr.crt\n"
                        },
                        "purposes": {
                            "sslclient": {
                                "ca": "",
                                "general": "1"
                            },
                            "sslserver": {
                                "ca": "",
                                "general": "1"
                            },
                            "nssslserver": {
                                "ca": "",
                                "general": "1"
                            },
                            "smimesign": {
                                "ca": "",
                                "general": ""
                            },
                            "smimeencrypt": {
                                "ca": "",
                                "general": ""
                            },
                            "crlsign": {
                                "ca": "",
                                "general": ""
                            },
                            "any": {
                                "ca": "1",
                                "general": "1"
                            },
                            "ocsphelper": {
                                "ca": "",
                                "general": "1"
                            },
                            "timestampsign": {
                                "ca": "",
                                "general": ""
                            }
                        }
                    },
                    "validation_type": "extended",
                    "crl": {
                        "1": {
                            "crl_uri": "http://sr.symcb.com/sr.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 30 09:01:05 2015 GMT\n",
                            "crl_next_update": "Apr  6 09:01:05 2015 GMT\n"
                        }
                    },
                    "ocsp": {
                        "1": {
                            "status": "good",
                            "this_update": "Mar 27 09:39:42 2015 GMT",
                            "next_update": "Apr 3 09:39:42 2015 GMT",
                            "ocsp_uri": "http://sr.symcd.com"
                        }
                    },
                    "hostname_in_san_or_cn": "false",
                    "serial": "319",
                    "key": {
                        "type": "rsa",
                        "bits": "2048",
                        "signature_algorithm": "sha256WithRSAEncryption",
                        "certificate_pem": "-----BEGIN CERTIFICATE-----\nMII[...]5rbdag==\n-----END CERTIFICATE-----\n",
                        "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMII[...]DAQAB\n-----END PUBLIC KEY-----\n",
                        "spki_hash": "Y4ViGKugRm0tW3lflAY9ZGTj6xga6CtiZpMwzbCZARs="
                    }
                },
                "2": {
                    "cert_data": {
                        "name": "/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 EV SSL CA - G3",
                        "subject": {
                            "C": "US",
                            "O": "Symantec Corporation",
                            "OU": "Symantec Trust Network",
                            "CN": "Symantec Class 3 EV SSL CA - G3"
                        },
                        "hash": "a0f7ac3e",
                        "issuer": {
                            "C": "US",
                            "O": "VeriSign, Inc.",
                            "OU": [
                                "VeriSign Trust Network",
                                "(c) 2006 VeriSign, Inc. - For authorized use only"
                            ],
                            "CN": "VeriSign Class 3 Public Primary Certification Authority - G5"
                        },
                        "version": "2",
                        "serialNumber": "168652503989349361584430187274382793396",
                        "validFrom": "131031000000Z",
                        "validTo": "231030235959Z",
                        "validFrom_time_t": "1383177600",
                        "validTo_time_t": "1698710399",
                        "extensions": {
                            "authorityInfoAccess": "OCSP - URI:http://s2.symcb.com\n",
                            "basicConstraints": "CA:TRUE, pathlen:0",
                            "certificatePolicies": "Policy: X509v3 Any Policy\n  CPS: http://www.symauth.com/cps\n  User Notice:\n    Explicit Text: http://www.symauth.com/rpa\n",
                            "crlDistributionPoints": "\nFull Name:\n  URI:http://s1.symcb.com/pca3-g5.crl\n",
                            "keyUsage": "Certificate Sign, CRL Sign",
                            "subjectAltName": "DirName: CN = SymantecPKI-1-533",
                            "subjectKeyIdentifier": "01:59:AB:E7:DD:3A:0B:59:A6:64:63:D6:CF:20:07:57:D5:91:E7:6A",
                            "authorityKeyIdentifier": "keyid:7F:D3:65:A7:C2:DD:EC:BB:F0:30:09:F3:43:39:FA:02:AF:33:31:33\n"
                        },
                        "purposes": {
                            "sslclient": {
                                "ca": "1",
                                "general": ""
                            },
                            "sslserver": {
                                "ca": "1",
                                "general": ""
                            },
                            "nssslserver": {
                                "ca": "1",
                                "general": ""
                            },
                            "smimesign": {
                                "ca": "1",
                                "general": ""
                            },
                            "smimeencrypt": {
                                "ca": "1",
                                "general": ""
                            },
                            "crlsign": {
                                "ca": "1",
                                "general": "1"
                            },
                            "any": {
                                "ca": "1",
                                "general": "1"
                            },
                            "ocsphelper": {
                                "ca": "1",
                                "general": "1"
                            },
                            "timestampsign": {
                                "ca": "1",
                                "general": ""
                            }
                        }
                    },
                    "validation_type": "organisation",
                    "crl": {
                        "1": {
                            "crl_uri": "http://s1.symcb.com/pca3-g5.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 18 00:00:00 2015 GMT\n",
                            "crl_next_update": "Jun 30 23:59:59 2015 GMT\n"
                        }
                    },
                    "ocsp": {
                        "1": {
                            "status": "good",
                            "this_update": "Mar 30 08:09:41 2015 GMT",
                            "next_update": "Apr 6 08:09:41 2015 GMT",
                            "ocsp_uri": "http://s2.symcb.com"
                        }
                    },
                    "hostname_in_san_or_cn": "n/a; ca signing certificate",
                    "serial": "105",
                    "key": {
                        "type": "rsa",
                        "bits": "2048",
                        "signature_algorithm": "sha256WithRSAEncryption",
                        "certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIF[...]tO7w+Q==\n-----END CERTIFICATE-----\n",
                        "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMII[...]ww0\nDwIDAQAB\n-----END PUBLIC KEY-----\n",
                        "spki_hash": "gMxWOrX4PMQesK9qFNbYBxjBfjUvlkn/vN1n+L9lE5E="
                    }
                },
                "3": {
                    "cert_data": {
                        "name": "/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5",
                        "subject": {
                            "C": "US",
                            "O": "VeriSign, Inc.",
                            "OU": [
                                "VeriSign Trust Network",
                                "(c) 2006 VeriSign, Inc. - For authorized use only"
                            ],
                            "CN": "VeriSign Class 3 Public Primary Certification Authority - G5"
                        },
                        "hash": "b204d74a",
                        "issuer": {
                            "C": "US",
                            "O": "VeriSign, Inc.",
                            "OU": "Class 3 Public Primary Certification Authority"
                        },
                        "version": "2",
                        "serialNumber": "49248466687453522052688216172288342269",
                        "validFrom": "061108000000Z",
                        "validTo": "211107235959Z",
                        "validFrom_time_t": "1162944000",
                        "validTo_time_t": "1636329599",
                        "extensions": {
                            "basicConstraints": "CA:TRUE",
                            "crlDistributionPoints": "\nFull Name:\n  URI:http://crl.verisign.com/pca3.crl\n",
                            "keyUsage": "Certificate Sign, CRL Sign",
                            "certificatePolicies": "Policy: X509v3 Any Policy\n  CPS: https://www.verisign.com/cps\n",
                            "subjectKeyIdentifier": "7F:D3:65:A7:C2:DD:EC:BB:F0:30:09:F3:43:39:FA:02:AF:33:31:33",
                            "1.3.6.1.5.5.7.1.12": "0_¡] [0Y0W0U\u0016\timage/gif0!0\u001f0\u0007\u0006\u0005+\u000e\u0003\u0002\u001a\u0004\u0014åÓ\u001a†¬ŽkÃπjÔH\u0018,{\u0019.0%\u0016#http://logo.verisign.com/vslogo.gif",
                            "authorityInfoAccess": "OCSP - URI:http://ocsp.verisign.com\n",
                            "extendedKeyUsage": "TLS Web Server Authentication, TLS Web Client Authentication, Code Signing, Netscape Server Gated Crypto, 2.16.840.1.113733.1.8.1"
                        },
                        "purposes": {
                            "sslclient": {
                                "ca": "1",
                                "general": ""
                            },
                            "sslserver": {
                                "ca": "1",
                                "general": ""
                            },
                            "nssslserver": {
                                "ca": "1",
                                "general": ""
                            },
                            "smimesign": {
                                "ca": "",
                                "general": ""
                            },
                            "smimeencrypt": {
                                "ca": "",
                                "general": ""
                            },
                            "crlsign": {
                                "ca": "1",
                                "general": "1"
                            },
                            "any": {
                                "ca": "1",
                                "general": "1"
                            },
                            "ocsphelper": {
                                "ca": "1",
                                "general": "1"
                            },
                            "timestampsign": {
                                "ca": "1",
                                "general": ""
                            }
                        }
                    },
                    "validation_type": "organisation",
                    "crl": {
                        "1": {
                            "crl_uri": "http://crl.verisign.com/pca3.crl",
                            "status": "ok",
                            "crl_last_update": "Mar 18 00:00:00 2015 GMT\n",
                            "crl_next_update": "Jun 30 23:59:59 2015 GMT\n"
                        }
                    },
                    "ocsp": "No OCSP URI found in certificate",
                    "hostname_in_san_or_cn": "n/a; ca signing certificate",
                    "serial": "234",
                    "key": {
                        "type": "rsa",
                        "bits": "2048",
                        "signature_algorithm": "sha1WithRSAEncryption",
                        "certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIE0DCCB[...]JjhJ+xr3/\n-----END CERTIFICATE-----\n",
                        "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMII[...]QAB\n-----END PUBLIC KEY-----\n",
                        "spki_hash": "JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg="
                    }
                }
            }
        }
    }