From: Michael D. Lowis Date: Tue, 17 Aug 2021 17:32:42 +0000 (-0400) Subject: added crypto api object X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=e9008c0b946c86086ddd40acb5ee7f3593ccf21e;p=proto%2Fachat.git added crypto api object --- diff --git a/static/client.js b/static/client.js index 4e5863c..7157a1f 100644 --- a/static/client.js +++ b/static/client.js @@ -36,6 +36,23 @@ const Data = { clr: () => localStorage.clear(), }; +/* + Cryptographic API +*/ +const Crypto = { + api: window.crypto.subtle, + gen: ()=> Crypto.api.generateKey( + { + name: "RSA-OAEP", + modulusLength: 4096, + publicExponent: new Uint8Array([1, 0, 1]), + hash: "SHA-256", + }, + true, + ["encrypt", "decrypt"] + ), +} + /* Chat Client Interface */