From ad39d54d192864b54a155bf5f94d5b6bb3e8612a Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 17 Aug 2018 16:57:41 +0200 Subject: js: removed Key.armor property in synchronous use -- * src/Key.js The synchronous mode for a Key does not offer an armor/ armored property anymore. This frees up a lot of performance issues, also the armored expoort is expected to change quite often, so a cached version is not advisable. * hasSecret/getHasSecret is now refactored, to reflect their uses. With get('hasSecret') there is a method that fetches the result. * src/Key.js also some refactoring --- lang/js/src/Keyring.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lang/js/src/Keyring.js') diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js index 43ab96c8..766bab15 100644 --- a/lang/js/src/Keyring.js +++ b/lang/js/src/Keyring.js @@ -38,12 +38,11 @@ export class GPGME_Keyring { * * @param {String | Array} pattern (optional) A pattern to * search for in userIds or KeyIds. - * @param {Boolean} prepare_sync (optional) if set to true, the - * 'hasSecret' and 'armored' properties will be fetched for the Keys as - * well. These require additional calls to gnupg, resulting in a - * performance hungry operation. Calling them here enables direct, - * synchronous use of these properties for all keys, without having to - * resort to a refresh() first. + * @param {Boolean} prepare_sync (optional) if set to true, most data + * (with the exception of armored Key blocks) will be cached for the + * Keys. This enables direct, synchronous use of these properties for + * all keys. It does not check for changes on the backend. The cached + * information can be updated with the {@link Key.refresh} method. * @param {Boolean} search (optional) retrieve Keys from external * servers with the method(s) defined in gnupg (e.g. WKD/HKP lookup) * @returns {Promise>} @@ -97,7 +96,6 @@ export class GPGME_Keyring { break; } } - // TODO getArmor() to be used in sync } } let k = createKey(result.keys[i].fingerprint, -- cgit v1.2.3