]> git.mdlowis.com Git - proto/achat.git/commitdiff
added crypto api object
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 17 Aug 2021 17:32:42 +0000 (13:32 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 17 Aug 2021 17:32:42 +0000 (13:32 -0400)
static/client.js

index 4e5863c96e6de87359016ebffe018a89fadfe23b..7157a1fe5a80a6aafe1f3178a6dd4c7353d12e50 100644 (file)
@@ -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
 */