From e9008c0b946c86086ddd40acb5ee7f3593ccf21e Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 17 Aug 2021 13:32:42 -0400 Subject: [PATCH] added crypto api object --- static/client.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 */ -- 2.55.0