diff options
author | Marvin Borner | 2018-07-20 13:57:57 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-20 13:57:57 +0200 |
commit | 932d439444f10774bff546923cc0a2e5e2f2857b (patch) | |
tree | ef9bcc039d263f929b4f4991881a52a8343c1dfe /resources/assets/js/initial_key_gen.js | |
parent | bd04ac097a0a29ba7c48a5f4a46d99ae7d86eea1 (diff) |
Rewrite (only for backend/oauth/api use from now on)
Diffstat (limited to 'resources/assets/js/initial_key_gen.js')
-rwxr-xr-x | resources/assets/js/initial_key_gen.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/resources/assets/js/initial_key_gen.js b/resources/assets/js/initial_key_gen.js deleted file mode 100755 index 1b6875f..0000000 --- a/resources/assets/js/initial_key_gen.js +++ /dev/null @@ -1,30 +0,0 @@ -$('form[keygen]').submit((event) => { - event.preventDefault(); - - $('button[type="submit"]').attr("disabled", true).html('Loading...'); - - var openpgp = window.openpgp; - - var options = { - userIds: [{ - email: $("input#email").val() - }], - numBits: 4096, - passphrase: $("input#password").val() - }; - - openpgp.generateKey(options).then((key) => { - var privateKey = key.privateKeyArmored; - var publicKey = key.publicKeyArmored; - - localStorage.setItem("privkey", privateKey); - - var now = new Date(); - var time = now.getTime(); - time += 3600 * 1000; - now.setTime(time); - document.cookie = "publickey=" + encodeURI(publicKey.substr(96).slice(0, -35)) + "; expires=" + now.toUTCString() + ";"; - - $('form[keygen]').unbind('submit').submit(); - }); -});
\ No newline at end of file |