aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
diff options
context:
space:
mode:
authorMarvin Borner2018-07-01 19:29:52 +0200
committerMarvin Borner2018-07-01 19:29:52 +0200
commit6c557a4be1a88de5dd681837bd77c50a98352168 (patch)
treeb403fb5383f03faa6a11e814c7264cadb59f08fe /resources
parent5dd4dd0d42c6360f6bc3ee1e1ab2ac23df41fbf5 (diff)
Began encryption (openpgp=
Diffstat (limited to 'resources')
-rw-r--r--resources/assets/js/app.js5
-rw-r--r--resources/assets/js/chat.js18
2 files changed, 20 insertions, 3 deletions
diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js
index 8400475..3c056ef 100644
--- a/resources/assets/js/app.js
+++ b/resources/assets/js/app.js
@@ -4,8 +4,7 @@
* building robust, powerful web applications using Vue and Laravel.
*/
-require('./bootstrap');
+window.openpgp = require('openpgp');
window.Vue = require('vue');
-// window.jQueryMigrate = require('jquery-migrate');
+require('./bootstrap');
require('./chat');
-
diff --git a/resources/assets/js/chat.js b/resources/assets/js/chat.js
index 794c78f..f2a8cb2 100644
--- a/resources/assets/js/chat.js
+++ b/resources/assets/js/chat.js
@@ -1,3 +1,21 @@
+var openpgp = window.openpgp;
+
+var options = {
+ userIds: [{ name:'Marvin Borner', email:'test@test.de' }], // multiple user IDs
+ numBits: 4096, // RSA key size
+ passphrase: 'cool password of private key'
+};
+
+openpgp.generateKey(options).then(function(key) {
+ var privateKey = key.privateKeyArmored; // '-----BEGIN PGP PRIVATE KEY BLOCK ... '
+ var publicKey = key.publicKeyArmored; // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
+
+ console.log(publicKey);
+ console.log(privateKey);
+});
+
+
+
var socket = io('http://127.0.0.1:8890', {
transports: ['websocket']
});