| 1277 | * ------v------*/ |
| 1278 | |
| 1279 | async serverVerify(e) { |
| 1280 | const type = e.detail.type; |
| 1281 | if (type === 'RSA') { |
| 1282 | const publickey = e.detail.publickey; |
| 1283 | let fingerprint = await window.crypto.subtle.digest("SHA-1", publickey); |
| 1284 | // The same fingerprint format as RealVNC |
| 1285 | fingerprint = Array.from(new Uint8Array(fingerprint).slice(0, 8)).map( |
| 1286 | x => x.toString(16).padStart(2, '0')).join('-'); |
| 1287 | document.getElementById('noVNC_verify_server_dlg').classList.add('noVNC_open'); |
| 1288 | document.getElementById('noVNC_fingerprint').innerHTML = fingerprint; |
| 1289 | } |
| 1290 | }, |
| 1291 | |
| 1292 | approveServer(e) { |
| 1293 | e.preventDefault(); |