aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/gpgmejs_openpgpjs.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-04-26 15:13:34 +0000
committerMaximilian Krambach <[email protected]>2018-04-26 15:13:34 +0000
commit1f7b19512cfa7e1b153b99d6a2b40bad82a5496e (patch)
tree73a0392bd738eb5023b904e3ab7b7b4e0a820768 /lang/js/src/gpgmejs_openpgpjs.js
parentjs: First testing and improvements (diff)
downloadgpgme-1f7b19512cfa7e1b153b99d6a2b40bad82a5496e.tar.gz
gpgme-1f7b19512cfa7e1b153b99d6a2b40bad82a5496e.zip
js: created TestExtension and smaller fixes
-- * Extensions: - Moved testapplication to Demoextension - Created BrowserTestExtension. Includes mocha and chai. For running tests that cannot be run outside a WebExtension Both Extensions can be found zipped in build/extensions after running build_extensions.sh * Code changes: - src/Config: Place for the configuration - small fixes raised during testing in Keyring.js, Message.js, - src/gpgmejs_openpgpjs.js don't offer direct GpgME object to the outside, as it only causes confusion - index.js init() now checks the config for validity * Tests: - Reordered tests in test/. - Input values are now in a separate file which may be of use for bulk testing * moved the build directory from dist to build
Diffstat (limited to 'lang/js/src/gpgmejs_openpgpjs.js')
-rw-r--r--lang/js/src/gpgmejs_openpgpjs.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/lang/js/src/gpgmejs_openpgpjs.js b/lang/js/src/gpgmejs_openpgpjs.js
index 4e5e1ea0..cc2afde1 100644
--- a/lang/js/src/gpgmejs_openpgpjs.js
+++ b/lang/js/src/gpgmejs_openpgpjs.js
@@ -50,18 +50,12 @@
if (!this._GPGME){
this._GpgME = new GpgME(connection, config);
}
- if (!this._Keyring){
- this._Keyring = new GPGME_Keyring_openpgpmode(connection);
+ if (!this._keyring){
+ this._keyring = new GPGME_Keyring_openpgpmode(connection);
}
}
}
- get GpgME(){
- if (this._GpGME){
- return this._GpGME;
- }
- }
-
/**
* Encrypt Message
* Supported:
@@ -115,7 +109,7 @@
return Promise.reject(GPMGEJS_Error('NOT_IMPLEMENTED'));
}
}
- return this.GpgME.encrypt(data, translateKeyInput(publicKeys), wildcard);
+ return this._GpgME.encrypt(data, translateKeyInput(publicKeys), wildcard);
}
/** Decrypt Message
@@ -152,7 +146,7 @@
return Promise.reject(GPMGEJS_Error('NOT_IMPLEMENTED'));
}
}
- return this.GpgME.decrypt(message);
+ return this._GpgME.decrypt(message);
// TODO: translate between:
// openpgp:
// { data:Uint8Array|String,