(results, req_type)
| 569 | } |
| 570 | |
| 571 | function display_certificate(results, req_type) { |
| 572 | var displayHTML = ""; |
| 573 | if (req_type === "ct_id" || req_type === "ct_sha1" || req_type === "ct_sha256") { |
| 574 | displayHTML = '<a href="/api/v1.0/ct/download/' + results['_id'] + '">Click to download the DER file</a><br/>'; |
| 575 | displayHTML += '<div class="bg-light"><pre>' + results['full_certificate'] + "</pre></div><br/>"; |
| 576 | } else if (req_type === "censys_sha1" || req_type === "censys_sha256") { |
| 577 | let cert_string = JSON.stringify(results[0]['p443']['https']['tls']['certificate']['parsed'], null, 2); |
| 578 | displayHTML += '<div class="bg-light"><pre>' + cert_string + "</pre></div><br/>"; |
| 579 | } else { |
| 580 | let tls_log; |
| 581 | if (Object.hasOwn(results[0]['data']['http']['response']['request'], 'tls_log')) { |
| 582 | // ZGrab 2.0 |
| 583 | tls_log = results[0]['data']['http']['response']['request']['tls_log']['handshake_log']; |
| 584 | } else { |
| 585 | // ZGrab |
| 586 | tls_log = results[0]['data']['http']['response']['request']['tls_handshake']; |
| 587 | } |
| 588 | let cert_string = JSON.stringify(tls_log['server_certificates']['certificate']['parsed'], null, 2); |
| 589 | displayHTML += '<div class="bg-light"><pre>' + cert_string + "</pre></div><br/>"; |
| 590 | } |
| 591 | |
| 592 | document.getElementById("cert_info").innerHTML = displayHTML; |
| 593 | } |
| 594 | |
| 595 | function fetch_certificate() { |
| 596 | var id = qs("id"); |
nothing calls this directly
no outgoing calls
no test coverage detected