(fname, target)
| 96 | return -1; |
| 97 | } |
| 98 | findCert(fname, target) { |
| 99 | let data = this.getIndex(fname, target); |
| 100 | if (data < 0) |
| 101 | return; // undefined |
| 102 | data = getResource("ca" + data + ".der"); |
| 103 | if (this.#verify) { |
| 104 | const validity = X509.decodeTBS(X509.decode(new Uint8Array(data)).tbs).validity; |
| 105 | const now = Date.now(); |
| 106 | if (!((validity.from < now) && (now < validity.to))) { |
| 107 | trace("date validation failed on certificate resource\n"); |
| 108 | return; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | return X509.decodeSPKI(data); |
| 113 | } |
| 114 | verify(certs, options) { |
| 115 | if (!this.#verify) |
| 116 | return true; |
no test coverage detected