From c569adb5e3e3082bd68cdc34a2d349b7c28d3768 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 19 Sep 2018 11:51:31 +0200 Subject: json: Remove subkey-algo from createkey command. * src/gpgme-json.c (op_createkey): Remove subkey-algo param. (GPG_AGENT_ALLOWS_KEYGEN_TRHOUGH_BROWSER): Fix typo. * lang/js/src/Keyring.js: Remove subkey-algo support. * lang/js/src/permittedOperations.js: Ditto. -- We do not want to expose details of the protocol's key generation and thus the subkey-algo does not make sense. Right now we support only the default and future-default algorithms. A user can configure them anyway using new-default-key-algo in gpg.conf. Eventually we may officially support a more flexible way of creating special structured OpenPGP keys but right now that is not part of the API. Signed-off-by: Werner Koch --- lang/js/src/Keyring.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lang/js/src/Keyring.js') diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js index e223284b..eec17116 100644 --- a/lang/js/src/Keyring.js +++ b/lang/js/src/Keyring.js @@ -387,13 +387,11 @@ export class GPGME_Keyring { * values. If ommitted, 'default' is used. * @param {Number} option.expires (optional) Expiration time in seconds * from now. If not set or set to 0, expiration will be 'never' - * @param {String} options.subkey_algo (optional) algorithm of the - * encryption subkey. If ommited the same as algo is used. * * @return {Promise} * @async */ - generateKey ({ userId, algo = 'default', expires= 0, subkey_algo } = {}){ + generateKey ({ userId, algo = 'default', expires= 0 } = {}){ if (typeof userId !== 'string' // eslint-disable-next-line no-use-before-define || (algo && supportedKeyAlgos.indexOf(algo) < 0 ) @@ -402,17 +400,11 @@ export class GPGME_Keyring { return Promise.reject(gpgme_error('PARAM_WRONG')); } // eslint-disable-next-line no-use-before-define - if (subkey_algo && supportedKeyAlgos.indexOf(subkey_algo) < 0){ - return Promise.reject(gpgme_error('PARAM_WRONG')); - } let me = this; return new Promise(function (resolve, reject){ let msg = createMessage('createkey'); msg.setParameter('userid', userId); msg.setParameter('algo', algo); - if (subkey_algo) { - msg.setParameter('subkey-algo',subkey_algo ); - } msg.setParameter('expires', expires); msg.post().then(function (response){ me.getKeys({ -- cgit v1.2.3