aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/js/initial_key_gen.js
diff options
context:
space:
mode:
authorMarvin Borner2018-07-07 16:13:20 +0200
committerMarvin Borner2018-07-07 16:13:20 +0200
commit84e758a59cea20508bad93a129acbad5d4474c5d (patch)
tree5e73aa7aa903e4e68ef40c681004bdc3bd979ae0 /public/js/initial_key_gen.js
parent82fa40442ad56f7de3cb6984bfb187e429476c76 (diff)
Added public/private key generation & insertion
Diffstat (limited to 'public/js/initial_key_gen.js')
-rw-r--r--public/js/initial_key_gen.js83
1 files changed, 83 insertions, 0 deletions
diff --git a/public/js/initial_key_gen.js b/public/js/initial_key_gen.js
new file mode 100644
index 0000000..07522c4
--- /dev/null
+++ b/public/js/initial_key_gen.js
@@ -0,0 +1,83 @@
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId]) {
+/******/ return installedModules[moduleId].exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ i: moduleId,
+/******/ l: false,
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.l = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+/******/
+/******/ // define getter function for harmony exports
+/******/ __webpack_require__.d = function(exports, name, getter) {
+/******/ if(!__webpack_require__.o(exports, name)) {
+/******/ Object.defineProperty(exports, name, {
+/******/ configurable: false,
+/******/ enumerable: true,
+/******/ get: getter
+/******/ });
+/******/ }
+/******/ };
+/******/
+/******/ // getDefaultExport function for compatibility with non-harmony modules
+/******/ __webpack_require__.n = function(module) {
+/******/ var getter = module && module.__esModule ?
+/******/ function getDefault() { return module['default']; } :
+/******/ function getModuleExports() { return module; };
+/******/ __webpack_require__.d(getter, 'a', getter);
+/******/ return getter;
+/******/ };
+/******/
+/******/ // Object.prototype.hasOwnProperty.call
+/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
+/******/
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "/";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(__webpack_require__.s = 44);
+/******/ })
+/************************************************************************/
+/******/ ({
+
+/***/ 44:
+/***/ (function(module, exports, __webpack_require__) {
+
+module.exports = __webpack_require__(45);
+
+
+/***/ }),
+
+/***/ 45:
+/***/ (function(module, exports) {
+
+eval("$('form[keygen]').submit(function (event) {\n event.preventDefault();\n\n $('button[type=\"submit\"]').attr(\"disabled\", true).html('Loading...');\n\n var openpgp = window.openpgp;\n\n var options = {\n userIds: [{\n email: $(\"input#email\").val()\n }],\n numBits: 4096,\n passphrase: $(\"input#password\").val()\n };\n\n openpgp.generateKey(options).then(function (key) {\n var privateKey = key.privateKeyArmored;\n var publicKey = key.publicKeyArmored;\n\n localStorage.setItem(\"privkey\", privateKey);\n\n var now = new Date();\n var time = now.getTime();\n time += 3600 * 1000;\n now.setTime(time);\n document.cookie = \"publickey=\" + encodeURI(publicKey.substr(96).slice(0, -35)) + \"; expires=\" + now.toUTCString() + \";\";\n\n $('form[keygen]').unbind('submit').submit();\n });\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9yZXNvdXJjZXMvYXNzZXRzL2pzL2luaXRpYWxfa2V5X2dlbi5qcz8xMDVlIl0sIm5hbWVzIjpbIiQiLCJzdWJtaXQiLCJldmVudCIsInByZXZlbnREZWZhdWx0IiwiYXR0ciIsImh0bWwiLCJvc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HtcbiAgICAgICAgdmFyIHByaXZhdGVLZXkgPSBrZXkucHJpdmF0ZUtleUFybW9yZWQ7XG4gICAgICAgIHZhciBwdWJsaWNLZXkgPSBrZXkucHVibGljS2V5QXJtb3JlZDtcblxuICAgICAgICBsb2NhbFN0b3JhZ2Uuc2V0SXRlbShcInByaXZrZXlcIiwgcHJpdmF0ZUtleSk7XG5cbiAgICAgICAgdmFyIG5vdyA9IG5ldyBEYXRlKCk7XG4gICAgICAgIHZhciB0aW1lID0gbm93LmdldFRpbWUoKTtcbiAgICAgICAgdGltZSArPSAzNjAwICogMTAwMDtcbiAgICAgICAgbm93LnNldFRpbWUodGltZSk7XG4gICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IFwicHVibGlja2V5PVwiICsgZW5jb2RlVVJJKHB1YmxpY0tleS5zdWJzdHIoOTYpLnNsaWNlKDAsIC0zNSkpICsgXCI7IGV4cGlyZXM9XCIgKyBub3cudG9VVENTdHJpbmcoKSArIFwiO1wiO1xuXG4gICAgICAgICQoJ2Zvcm1ba2V5Z2VuXScpLnVuYmluZCgnc3VibWl0Jykuc3VibWl0KCk7XG4gICAgfSk7XG59KTtcblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9yZXNvdXJjZXMvYXNzZXRzL2pzL2luaXRpYWxfa2V5X2dlbi5qcyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///45\n");
+
+/***/ })
+
+/******/ }); \ No newline at end of file