Skip to content

Instantly share code, notes, and snippets.

@worace
Created May 29, 2016 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worace/a89d50eadf4f4937f793df9a1dbdc045 to your computer and use it in GitHub Desktop.
Save worace/a89d50eadf4f4937f793df9a1dbdc045 to your computer and use it in GitHub Desktop.
Electron Woes
ipc.on("request-rsa-key", (event, keyLength) => {
console.log("Renderer requested RSA key of length", keyLength);
var k = new NodeRSA({b: keyLength})
event.sender.send('rsa-key', k);
console.log("***** Main Finished Key *****")
});
(.on ipc
"rsa-key"
(fn [event kp]
(set! (.-keyPair js/window) kp)
(println "Recevied key:" kp)
(write-file (str wallet-directory "/" file-name ".der") (private-der kp))
(println "wrote wallet file")
(a/put! channel {:event :wallet-loaded
:data {:address (public-der kp)
:key kp
:name file-name}})))
(.send ipc "request-rsa-key" 2048)
(println "Sent request to main...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment