aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Keyring.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-04 10:11:35 +0000
committerMaximilian Krambach <[email protected]>2018-07-04 10:11:35 +0000
commit1105fc87a3bd3e1152aff578b7b84871558418e6 (patch)
tree75aeb36d9f5087b997001b484894e2cab7853c4d /lang/js/src/Keyring.js
parentjs: fixing Key import/export test (diff)
downloadgpgme-1105fc87a3bd3e1152aff578b7b84871558418e6.tar.gz
gpgme-1105fc87a3bd3e1152aff578b7b84871558418e6.zip
js: add Key lookup
-- * src/Keyring.js: getKeys() now has the option "search", which will trigger a remote lookup (as configured in gpg) for the string given as pattern. * src/permittedOperations: make use of the new 'locate' option in keylist * DemoExtension: Add a button for lookup, to demonstrate the functionality
Diffstat (limited to '')
-rw-r--r--lang/js/src/Keyring.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js
index 8bec1cea..0d7643f0 100644
--- a/lang/js/src/Keyring.js
+++ b/lang/js/src/Keyring.js
@@ -39,16 +39,21 @@ export class GPGME_Keyring {
* inmediately. This allows for full synchronous use. If set to false,
* these will initially only be available as Promises in getArmor() and
* getHasSecret()
+ * @param {Boolean} search (optional) retrieve the Keys from servers with
+ * the method(s) defined in gnupg (e.g. WKD/HKP lookup)
* @returns {Promise.<Array<GPGME_Key>>}
*
*/
- getKeys(pattern, prepare_sync){
+ getKeys(pattern, prepare_sync, search){
return new Promise(function(resolve, reject) {
let msg = createMessage('keylist');
if (pattern !== undefined){
msg.setParameter('keys', pattern);
}
msg.setParameter('sigs', true);
+ if (search === true){
+ msg.setParameter('locate', true);
+ }
msg.post().then(function(result){
let resultset = [];
let promises = [];