diff --git a/golang/wasm/pure.js b/golang/wasm/pure.js index f682243..097f473 100644 --- a/golang/wasm/pure.js +++ b/golang/wasm/pure.js @@ -762,3 +762,22 @@ async function handleFileSelection(event) { } } + const downloadKeys = () => { + const zip = new JSZip(); + + Object.keys(localStorage).forEach(keyName => { + const item = JSON.parse(localStorage.getItem(keyName)); + + if (item?.key && item?.private) { + zip.file(`${keyName}.key`, item.key); + zip.file(`${keyName}.private`, item.private); + } + }); + + zip.generateAsync({ type: "blob" }).then(content => { + const a = document.createElement("a"); + a.href = URL.createObjectURL(content); + a.download = "keys.zip"; + a.click(); + }); +} \ No newline at end of file diff --git a/golang/wasm/wasm_exec.html b/golang/wasm/wasm_exec.html index edaf521..3993a43 100644 --- a/golang/wasm/wasm_exec.html +++ b/golang/wasm/wasm_exec.html @@ -6,6 +6,7 @@ Go<>JS Demo +

DNS

@@ -21,6 +22,7 @@

DNS Keys

List Keystore

+

Request

@@ -43,76 +45,12 @@

Find DOH Endpoint for a given Subdomain

-

Import Key pair files from filesystem into Browser Keystore

+

Import Key pair files from filesystem into Browser Keystore

- +

- diff --git a/golang/wasm/wasm_exec_es6.html b/golang/wasm/wasm_exec_es6.html deleted file mode 100644 index 022c37b..0000000 --- a/golang/wasm/wasm_exec_es6.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Go<>JS Demo - - - - -

DNS

-

DOH Resolver

-

- - - -


-  

- -

DNS Keys

-

List Keystore

- - -
- -

Request

-

- - -

- -

Search Keystore for Key to sign update for a given Subdomain

-

- - -

-

- -

Find DOH Endpoint for a given Subdomain

-

- - -

-

- -

Import Key pair files from filesystem into Browser Keystore

-

- -

-
-

- -