2018-09-18 12:06:59 +00:00
|
|
|
function decryptResponse(plaintext, error) {
|
|
|
|
console.log(["decryptResponse", plaintext, error])
|
2018-09-17 14:41:02 +00:00
|
|
|
}
|
|
|
|
|
2018-09-18 12:06:59 +00:00
|
|
|
function encryptResponse(ciphertext, error) {
|
|
|
|
console.log(["encryptResponse", ciphertext, error])
|
|
|
|
if (error === null) {
|
2018-09-18 17:24:43 +00:00
|
|
|
opensslDecrypt(ciphertext, "password", decryptResponse)
|
2018-09-18 12:06:59 +00:00
|
|
|
}
|
2018-09-17 14:41:02 +00:00
|
|
|
}
|
|
|
|
|
2018-09-18 12:06:59 +00:00
|
|
|
function opensslLoaded() {
|
2018-09-18 17:24:43 +00:00
|
|
|
opensslEncrypt("Knut", "password", encryptResponse)
|
2018-09-17 14:41:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const go = new Go()
|
2018-09-18 16:42:46 +00:00
|
|
|
WebAssembly.instantiateStreaming(fetch("openssl.wasm"), go.importObject).then(async obj => await go.run(obj.instance))
|