MCPcopy Create free account
hub / github.com/adobe/Marinus / fetch_certificate

Function fetch_certificate

web_server/public/javascripts/certs.js:595–635  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

593}
594
595function fetch_certificate() {
596 var id = qs("id");
597 var sha1 = qs("sha1");
598 var sha256 = qs("sha256");
599 var req_type = ""
600 var url = "";
601 if (id) {
602 url = "/api/v1.0/ct/id/" + id;
603 req_type = "ct_id";
604 } else if (sha1) {
605 let rec_type = qs("type");
606 if (rec_type === "ct_sha1") {
607 url = "/api/v1.0/ct/fingerprint/" + sha1;
608 req_type = "ct_sha1";
609 } else if (rec_type === "censys_sha1") {
610 url = "/api/v1.0/censys/certs?fingerprint_sha1=" + sha1;
611 req_type = "censys_sha1";
612 } else {
613 url = "/api/v1.0/zgrab/443/certs?fingerprint_sha1=" + sha1;
614 req_type = "zgrab_sha1";
615 }
616 } else if (sha256) {
617 let rec_type = qs("type");
618 if (rec_type === "ct_sha256") {
619 url = "/api/v1.0/ct/fingerprint/" + sha256;
620 req_type = "ct_sha256";
621 } else if (rec_type === "censys_sha1") {
622 url = "/api/v1.0/censys/certs?fingerprint_sha256=" + sha256;
623 req_type = "censys_sha256";
624 } else {
625 url = "/api/v1.0/zgrab/443/certs?fingerprint_sha256=" + sha256;
626 req_type = "zgrab_sha256";
627 }
628 }
629
630 if (url === "") {
631 document.getElementById("cert_info").innerHTML = "<b>No ID was provided!</b>";
632 }
633
634 make_get_request(url, display_certificate, req_type, "cert_info");
635}
636
637function display_issuers(results, name) {
638 var displayHTML = create_new_list("issuers");

Callers 1

buildPageFunction · 0.85

Calls 2

qsFunction · 0.85
make_get_requestFunction · 0.85

Tested by

no test coverage detected