(cert)
| 267 | return (new pk(spki, false, [] /* any oid */)).verify((new Crypt.Digest(hash)).process(x509.tbs), sig); |
| 268 | } |
| 269 | register(cert) { |
| 270 | if (this.#verify) { |
| 271 | let validity = X509.decodeTBS(X509.decode(new Uint8Array(cert)).tbs).validity, now = Date.now(); |
| 272 | if (!((validity.from < now) && (now < validity.to))) |
| 273 | throw new Error("date validation failed"); |
| 274 | } |
| 275 | |
| 276 | this.#registeredCerts.push(cert); |
| 277 | } |
| 278 | getDH() { |
| 279 | let dh = getResource("dh.der"); |
| 280 | let ber = new BER(dh); |