gpgme/lang/js
Maximilian Krambach d62f66b1fb js: Key handling stubs, Error handling, refactoring
--

* Error handling: introduced GPGMEJS_Error class that handles errors
  at a more centralized and consistent position
* src/Connection.js:
  The nativeMessaging port now opens per session instead of per
  message. Some methods were added that reflect this change
  - added methods disconnect() and reconnect()
  - added connection status query
* src/gpgmejs.js
  - stub for key deletion
  - error handling
  - high level API for changing connection status
* src/gpgmejs_openpgpjs.js
  - added stubs for Key/Keyring handling according to current
    state of discussion. It is still subject to change
* src/Helpers.js
  - toKeyIdArray creates an array of KeyIds, now accepting
    fingerprints, GPGMEJS_Key objects and openpgp Key objects.
* Key objects (src/Key.js) Querying information about a key
  directly from gnupg. Currently a stub, only the Key.fingerprint is
  functional.
* Keyring queries (src/Keyring.js): Listing and searching keys.
  Currently a stub.
2018-04-23 17:18:46 +02:00
..
src js: Key handling stubs, Error handling, refactoring 2018-04-23 17:18:46 +02:00
CHECKLIST js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
CHECKLIST_build js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
manifest.json js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
package.json js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
README js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
test_index.js js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
testapplication_index.html js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
testapplication.js js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
testicon.png js: Initial commit for JavaScript Native Messaging API 2018-04-10 18:47:59 +02:00
ui2.html js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00
ui.css js: Initial commit for JavaScript Native Messaging API 2018-04-10 18:47:59 +02:00
webpack.conf.js js: encrypt improvement and decrypt method 2018-04-20 15:24:13 +02:00

gpgmejs, as contained in this directory, is a javascript library for direct use
of gnupg in browsers, with the help of nativeMessaging.

Installation
-------------
gpgmejs uses webpack, and thus depends on nodejs for building. Webpack can be
installed by running
`npm install webpack webpack-cli --save-dev`.

To create a current version of the package, the command is
`npx webpack --config webpack.conf.js`.
If you want a more debuggable (i.e. not minified) build, just change the mode
in webpack.conf.js.

TODO: gpgme_openpgpjs aims to offer an API similar to openpgpjs, throwing errors
if some part of the API is not implemented, 'translating' objects if possible.
This will be incorporated into the build process later, for now it is a line to
uncomment in src/index.js

Demo WebExtension:
As soon as a bundled webpack is in dist/
the gpgmejs folder can just be included in the extensions tab of the browser in
questions (extension debug mode needs to be active). For chrome, selecting the
folder is sufficient, for firefox, the manifest.json needs to be selected.
Please note that it is just for demonstration/debug purposes!

In the browsers' nativeMessaging configuration folder a file 'gpgmejs.json'
is needed, with the following content:

(The path to the native app gpgme-json may need adaption)

Chromium:
~/.config/chromium/NativeMessagingHosts/gpgmejson.json

{
  "name": "gpgmejson",
  "description": "This is a test application for gpgmejs",
  "path": "/usr/bin/gpgme-json",
  "type": "stdio",
  "allowed_origins": ["chrome-extension://ExtensionIdentifier/"]
}
The ExtensionIdentifier can be seen on the chrome://extensions page, and
changes on each reinstallation. Note the slashes in allowed_origins.


Firefox:
~/.mozilla/native-messaging-hosts/gpgmejson.json
{
  "name": "gpgmejson",
  "description": "This is a test application for gpgmejs",
  "path": "/usr/bin/gpgme-json",
  "type": "stdio",
  "allowed_extensions": ["ExtensionIdentifier@temporary-addon"]
}
The ExtensionIdentifier can be seen as Extension ID on the about:addons page if
addon-debugging is active. In firefox, the temporary addon is removed once
firefox exits, and the identifier will need to be changed more often.