1
0
mirror of https://github.com/Luzifer/wasm-openssl.git synced 2024-09-18 23:42:57 +00:00
WASM wrapper around go-openssl to be used in Javascript projects
Go to file
Knut Ahlers d469b667c7
Initial test
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-09-17 16:48:41 +02:00
.gitignore Initial test 2018-09-17 16:48:41 +02:00
go.mod Initial test 2018-09-17 16:48:41 +02:00
go.sum Initial test 2018-09-17 16:48:41 +02:00
index.html Initial test 2018-09-17 16:48:41 +02:00
index.js Initial test 2018-09-17 16:48:41 +02:00
main.go Initial test 2018-09-17 16:48:41 +02:00
Makefile Initial test 2018-09-17 16:48:41 +02:00
README.md Initial test 2018-09-17 16:48:41 +02:00

go-openssl Wrapper for WASM support

$ make
GOOS=js GOARCH=wasm go build -o main.wasm main.go
gzip -c main.wasm > main.wasm.gz
curl -sSfLo wasm_exec.js "https://raw.githubusercontent.com/golang/go/go1.11/misc/wasm/wasm_exec.js"

$ ls -lh main.wasm*
-rwxr-xr-x 1 luzifer luzifer 2.8M Sep 17 16:43 main.wasm
-rw-r--r-- 1 luzifer luzifer 611K Sep 17 16:43 main.wasm.gz

Chrome dev console output:

(index):14 (2) ["encryptResponse", "U2FsdGVkX1/baq9kUCX1EmUY/XZfnz7CwqGr70vqo6g="]
(index):10 (2) ["decryptResponse", "Knut"]