(cert)
| 66 | return [getResource("srvcert.der")]; |
| 67 | } |
| 68 | getKey(cert) { |
| 69 | // look for the key corresponding to the cert |
| 70 | // first, search in the registed cert |
| 71 | for (let i = 0, registeredCerts = this.#registeredCerts.concat(globalCerts); i < registeredCerts.length; i++) { |
| 72 | if (0 === Bin.comp(registeredCerts[i], cert)) { |
| 73 | const x509 = X509.decode(registeredCerts[i]); |
| 74 | return x509.spki; // public key only |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // at the moment there is only one key |
| 79 | if (this.#clientCertificates[0]) { |
| 80 | if (0 === Bin.comp(this.#clientCertificates[0], cert)) |
| 81 | return PKCS8.parse(new Uint8Array(this.#clientKey)); |
| 82 | } |
| 83 | } |
| 84 | findPreferredCert(types, names) { |
| 85 | return this.#clientCertificates ?? []; |
| 86 | } |
no test coverage detected