aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Keyring.js (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-11-08spelling: fix misspellingsDaniel Kahn Gillmor1-1/+1
Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2018-10-18doc: use https:// for www.gnu.orgDaniel Kahn Gillmor1-1/+1
-- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2018-09-20js: renamed keygen algo optionMaximilian Krambach1-2/+2
-- * src/Keyring.js: Confused default-future with future-default * reverts commit 34be6163f6c1057e2a87705925a9d0c70e4ecf17
2018-09-19js: add 'default-future' as createKey optionMaximilian Krambach1-1/+1
-- * src/Keyring.js: default-future can be used now for key creation as algo.
2018-09-19json: Remove subkey-algo from createkey command.Werner Koch1-9/+1
* 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 <[email protected]>
2018-09-05js: documentation cleanupMaximilian Krambach1-5/+5
--
2018-08-27js: typecheck destructured parametersMaximilian Krambach1-9/+16
-- * destructuring just takes the input argument and treats it as object. In cases like in src/Keyring/generateKey, where I forgot to change the old syntax, the fingerprint as string was destructured into an object without "pattern", which caused all Keys to be retrieved. So, methods with a destructuring now check if the first argument is an object and get a default empty object if no parameter is submitted. This allows the further use of destructured parameters, while still ensuring nothing vastly incorrect is used. * src/Kering.js, unittsets.js: fixed old syntax in method usage
2018-08-23js: fix syntax inside Keyring methodsMaximilian Krambach1-1/+2
-- * recent changes in parameter calling led to a forgotten internal call in getDefaultKey using old syntax (and failing in case a default key is configured)
2018-08-23js: use destructured option parametersMaximilian Krambach1-55/+25
-- * Adds to f0409bbdafcbd4f8b0be099a6b3ce0d5352c9bcd and makes use of destructuring, allowing for defaults, and cleaning up the validation.
2018-08-23js: update getDefaultKey to more precise logicMaximilian Krambach1-1/+6
-- * src/Keyring.js: Adapted Keyring.getDefaultKey() to my current understanding of a default signing key: either the default key set in the gpg config, or 'the first usable private key' - usability meaning 'not invalid, expired, revoked, and can be used for signing'. It should be the same key used as in command line when doing a --sign operation. In case the user has a smartcard plugged in, we currently won't know of this here, so our choice may differ. But as we do all javascript-binding sign operations with the key fingerprint explicitly set, this should not be a real problem. This method is seen more as a convenience to tell using librarys which key represents the main user.
2018-08-22js: make method parameters objectsMaximilian Krambach1-57/+86
-- * As requested by using parties, the options to be passed into the methods are now objects, with the objects' properties better describing what they do, and to avoid the need to type several nulls in a method call if one wants the last parameter. - src/Keyring.js, src/gpgme.js: Changed parameters and their validations - BrowserTest/*.js Had to adapt quite some calls to the new format
2018-08-22js: throw errors in sync functionsMaximilian Krambach1-1/+3
-- * synchronous functions should throw errors if something goes wrong, Promises should reject. This commit changes some error cases that returned Error objects instead of throwing them - src/Key.js: createKey() and sync Key.get() throw errors - src/Error.js: Exporting the list of errors to be able to test and compare against these strings - src/Keyring.js: Setting a null value in pattern is not useful, and now caused an error with the new changes. - src/Message.js: createMessage and Message.setParameter now throw errors
2018-08-21js: set expiry of generatedKey to seconds from nowMaximilian Krambach1-6/+4
-- * src/Keyring.js: Changed key ecpiration from Date to seconds from creation, as in gpgme. The Date parameter used before was due to a misunderstanding in documentation and requests from potential users.
2018-08-20js: add option "subkey-algo" to generateKeyMaximilian Krambach1-2/+11
-- * The option was recently added to gpgme-json; this reflects this on javascript side
2018-08-20js: set expiry date on generateKeyMaximilian Krambach1-1/+2
-- * on the javascript side a Date is expected, gpggme-json expects seconds from 'now'
2018-08-20js: add and apply eslint rulesMaximilian Krambach1-42/+41
-- * mainly spacing, see .eslintrc.json for details
2018-08-20js: revert changes to class read/write restrictionMaximilian Krambach1-337/+338
-- * undoes 94ee0988d4eaac27785de6efb7c19ca9976e1e9c and e16a87e83910ebb6bfdc4148369165f121f0997e. I do not fully understand why my approach was bad, but I am not in a position to argue. This revert was requested to me after a review, and I'm doing it in the assumption that more experienced people know better than me. * unittests: Also changed some outdated tests that stopped working since 754e799d35fd62d7a979452f44342934659908c7 (as GPGME_Key is not exported, one cannot check for instanceof in the tests anymore)
2018-08-17js: don't expire new keys if no date is setMaximilian Krambach1-0/+2
-- * src/Keyring.js A new Key without expiration is documented as 'never expire' here, and should behave accordingly. This requires sending '0' here.
2018-08-17js: removed Key.armor property in synchronous useMaximilian Krambach1-7/+5
-- * 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
2018-08-17js: disallow bulk set data on key from outsideMaximilian Krambach1-5/+6
-- * src/Key.js Key class is not exported anymore, as it should not be used directly anywhere. setKeyData is no more a method of the Key, (optional) data are now validated and set on Key creation and on updates, both from within this module, thus no longer exposing setKeyData to the outside. * createKey now gained an optional parameter which allows to set Key data at this point.
2018-08-16js: importKey feedback refactorMaximilian Krambach1-18/+13
-- * src/Keyring.js: An empty result should no longer cause an error, the import feedback summary has been refactored slightly * Browsertests to reflect import feedback change
2018-08-16js: fix import feedbackMaximilian Krambach1-1/+9
-- * src/Keyring.js For Key imports without prepare_sync the import feedback was lacking the summary
2018-08-16js: wrong object assumed in recent commitMaximilian Krambach1-2/+5
-- * src/Keyring.js I wrongly assumed an object to be a GPGME_Key, it was the raw answer from nativeMessaging instead. Now it returns a GPGME_Key again.
2018-08-16js: get default key fixesMaximilian Krambach1-7/+15
-- * src/Keyring.js: The answer was not parsed correctly, so a config was being ignored. * If no config is set, we return the first non-invalid key with a secret, instead of the first key (which may be e.g. an expired one)
2018-08-16js: simplify getDefaultKeyMaximilian Krambach1-11/+7
-- * src/Keyring.js: In case no default Key is set in configuration, only Keys reported as having a secret part should be considered for default Keys, avoiding some extra requests.
2018-07-31js: fix confusion about loop in last commitMaximilian Krambach1-2/+1
-- * The aim is to iterate through the results of the first request (all keys), and then add the propert 'hasSecret' to those that are in the second request (secret Keysring) as well. I messed this up in a recent change, and it escaped testing.
2018-07-31js: Fix Key.hasSecret answerMaximilian Krambach1-4/+6
-- * The comparision result between Keyring and Keyring with secrets was set to the wrong Object which was not returned at all.
2018-07-27js: fix indentaionMaximilian Krambach1-322/+331
-- * doing the indentation changes that became neccesary in the last commit.
2018-07-27js: change the write access for js class methodsMaximilian Krambach1-13/+13
-- * src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]: Functions and values that are not meant to be overwritten are now moved into their constructors, thus eliminating the possibility of overwrites after initialization. * Key: The mode of use (synchronous cached, or async promises) ivs now determined at initialization of that Key. The property Key.isAsync reflects this state. * unittests: fixed old Key syntax for testing. * Message.js isComplete is now a method and not a getter anymore. * Added some startup tests.
2018-07-17js: fix getkeys with locate optionMaximilian Krambach1-2/+4
-- * src/Keyring.js: As locate will not work with the "secret" option, the first message cannot be reused, thus a new one must be created here
2018-07-12js: allow optional Key retrieve pattern to be nullMaximilian Krambach1-2/+2
-- * src/Keyring.js: If the optional "pattern" parameter is not to be used, but another, following parameter is, null is more of a convention in javascript, thus both null and undefined are interpreted as "this parameter is not meant to be set".
2018-07-12js: add with-sec-fprs to getKeysArmoredMaximilian Krambach1-7/+27
-- * Reflects the changes made to gpgme-json in commit 6cc842c9aa76d19448141e5117ac59452d7a1ff3. - getKeysArmored now returns an object with property 'armored' being the exported armored block, and an (optional) array of fingerprint strings for those keys that can be used in sign/encrypt operations as property 'secret_fprs'. With this, extensions such as mailvelope will be able to bulk fetch all necessary key information in one request.
2018-07-10js: documentationMaximilian Krambach1-50/+82
-- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default
2018-07-09js: reduce request spam at getKeys()Maximilian Krambach1-17/+35
-- * Don't make a secret-Key request for each Key retrieved, use one request for all of them instead, and assemble the info later. This should reduce the traffic with large Keyrings. The bulk retrieval for the public armored Keys for each of these Keys is still up to discussion * unittests: disabled assertion for the armored key (as it currently doesn't work) * encryptTest: clarified the mechanism/reason of rejection for Messages >64 MB. This is still a TODO, as this error comes from a different place (the browser itself) and behaves different from the other errors.
2018-07-04js: Add jsdoc, update webpack-cli dependencyMaximilian Krambach1-3/+3
-- * package.json: - the old webpack-cli version depended on two packages with vulnerabilities, set to minimum version 3.0.8 to fix this (nodesecurity.io/advisories/157, nodesecurity.io/advisories/612) - added License identifier * README: Updated documentation * jsdoc.conf: Added a configuration file for jsdoc * some minor documentation changes, indentations
2018-07-04js: add Key lookupMaximilian Krambach1-1/+6
-- * 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
2018-06-19js: getDefaultKey and GenerateKey improvementsMaximilian Krambach1-12/+10
-- * src/Keyring.js: added more options for key generation. * src/Key.js: GetDefaultKey now relies on the info associated with the key, as the approach of relying on a secret subkey did not work as intended * DemoExtension: Added a button for retrieval of the subkey, to test this functionality.
2018-06-14js: import result feedbackMaximilian Krambach1-18/+36
-- * src/Keyring.js: Changed and documented the import result feedback towards the javascript side
2018-06-14js: add verify and signature parsingMaximilian Krambach1-2/+0
-- * src/gpgmejs.js: - Added verify method - Added verification results in decrypt (if signatures are present in the message) - Added a base64 option to decrypt * src/Signature.js: Convenience class for verification results. Used for e.g. converting timestamps to javascript time, quick overall validity checks * src/Keyring.js: removed debug code * src/Errors.js add two new Signature errors
2018-06-13js: getDefaultKey and verify fixMaximilian Krambach1-1/+55
-- * DemoExtension/maindemo.js - added a Demo for retrieving the default signing key * src/Errors.js - add a new Error if no default key can be determined * src/Key.js added documentation and a TODO marker for hasSecret. * src/Keyring.js implemented getDefaultKey * src/permittedOperations.js: Added missing entry for verify, added config_opt
2018-06-11js: Add key creation to KeyringMaximilian Krambach1-1/+59
-- * src/Keyring.js: Added method generateKey for new Keys Still TODO: Key length and some further testing. Automated testing does not work in this case, and gpgmejs will not be able to delete test keys again. * src/permittedOperations.js Added new method's definitions according to gpgme-json
2018-06-06js: code cleanup (eslint)Maximilian Krambach1-12/+20
-- * trying to stick to eslint from now on for readability * As some attribution was lost in previous git confusions, I added my name into some of the licence headers
2018-06-06js: implement import/delete Key, some fixesMaximilian Krambach1-26/+118
-- * Keyring.js - implemented importKey: importing one or more armored public key blocks. - implemented deleteKey: deleting a public Key from gpg. * Key.js renamed property Key.armor to Key.armored * Helpers.js: toKeyIDArray does not complain anymore if there are no keys. Not having Keys in e.g. signing keys in encrypt is legitimate and common, the complaints were getting spammy * Errors.js: gpgme_errors now always pass an optional additional message, for easier debugging in minified code * Connection.js: Fix in gpgme-json responses containing objects * eslintrc.json: Start using eslint. A cleanup to conform to it is not done yet * Added further tests for the new functionality
2018-05-30js: more Keyring/Key handlingMaximilian Krambach1-6/+26
-- * src/Keys.js - made setKeyData more consistent with other methods - added convenience methods (Key.armored, Key.hasSecret) - Added a Key delete function * src/Keyring.js: - added a getkeysArmored which allows for bulk export of public Keys gpgmejs: - removed deleteKey. It is now a method of the Key itself - Encrypt: Added some common options as parameter, and the possibility to set all allowed flags via an additional Object
2018-05-28js: Keyring listing keysMaximilian Krambach1-96/+33
-- * implementing Keyring methods: - Keyring.getKeys: has an additional option that retrieves the armor and secret state once at the beginning. This is power hungry, but allows for Keys to be used directly (without querying gpgme-json each call) * permittedOperations.js: reflect recent changes in the native counterpart, adding more options * Key: adding two methods for retrieving the armored Key block and for finding out if the Key includes a secret subkey.
2018-05-28js: Treat a connection as a gpgme ContextMaximilian Krambach1-17/+3
-- * After an operation a connection should be disconnected again. The "end of operation" is now assumed to be either an error as answer, or a message not including a "more" * GPGME, GPGME_Key, GPGME_Keyring don't require a connection anymore * Message.js: The Message.post() method will open a connection as required
2018-05-25js: use version operation for connection checksMaximilian Krambach1-31/+27
-- * src/Connection.js: isConnected was renamed to checkConnection, that returns a promise with either version information or Boolean * Connection checks have been adapted to reflect that checkConnection returns a Promise * BrowsertestExtension: tests/signTest.js was missing from my last commit
2018-05-03js: Added browser testing for unit testsMaximilian Krambach1-1/+1
-- * Added unittests to be run inside a Browser. To be able to access the non-exposed functions and classes, a testing bundle will be created, containing the tests (unittests.js) and the items to be tested. * src/Helpelpers, src/Key, src/Keyring: fixed some errors found during testing.
2018-05-03js: changed Key class stubMaximilian Krambach1-1/+2
-- * src/Key.js: A Key object cannot offer more than basic functionality outside a connection, so it now requires a connection to be present.
2018-04-27js: more testingMaximilian Krambach1-0/+4
-- * Tests: initialization of the two modes, encryption * gpgme.js: reintroduced message check before calling Connection.post() * gpgmejs_openpgp.js: Fixed openpgp mode not passing keys * index.js: fixed some confusion in parseconfig() * Inserted some TODO stubs for missing error handling