aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-24 12:56:33 +0000
committerMaximilian Krambach <[email protected]>2018-07-24 12:56:33 +0000
commit4b343c4e339862a5faf8dd20590a3c4592fb6abb (patch)
tree8fb9eb1e9a7414f17979f7af30bd6860ad0a3a18 /lang/js/src
parentjs: Fix wrong encoding in received error messages (diff)
downloadgpgme-4b343c4e339862a5faf8dd20590a3c4592fb6abb.tar.gz
gpgme-4b343c4e339862a5faf8dd20590a3c4592fb6abb.zip
js: include armored Key in import callback
-- * The import answer now also directly contains the armored Key as Key property, without need to refresh the Key object created in the answer. This allows for direct comparision of input and output. * BrowserTestExtension: added test for that import callback
Diffstat (limited to 'lang/js/src')
-rw-r--r--lang/js/src/Key.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lang/js/src/Key.js b/lang/js/src/Key.js
index 30f507c1..b024a77b 100644
--- a/lang/js/src/Key.js
+++ b/lang/js/src/Key.js
@@ -141,7 +141,7 @@ export class GPGME_Key {
* during a session. The key still can be reloaded by invoking
* {@link refreshKey}.
* @returns {*|Promise<*>} the value (Boolean, String, Array, Object).
- * If 'cached' is true, the value will be resolved as a Promise.
+ * If 'cached' is false, the value will be resolved as a Promise.
*/
get(property, cached=true) {
if (cached === false) {
@@ -194,8 +194,11 @@ export class GPGME_Key {
if (result.keys.length === 1){
me.setKeyData(result.keys[0]);
me.getHasSecret().then(function(){
- //TODO retrieve armored Key
- resolve(me);
+ me.getArmor().then(function(){
+ resolve(me);
+ }, function(error){
+ reject(error);
+ });
}, function(error){
reject(error);
});