freedomjs/freedom-pgp-e2e — pull request #8 by soycode (2014-10-13 21:03:00+00:00)
Title: Soycode newapi

These commits change the API to a simpler four functions (as discussed in https://github.com/freedomjs/freedom-pgp-e2e/issues/4), and get it working for the current relatively simple tests and demo chrome app. The main thing that could probably use more cleaning up is the use of e2e.async.Result.getValue (and perhaps async/promises in general) - the e2e people have told me they plan to deprecate that within a year. And also, while I for one like this simple API, we will likely need to extend it if we want to persist encrypted data to disk (i.e. https://github.com/freedomjs/freedom-pgp-e2e/issues/7).

Feedback welcome, and I will likely poke at it a bit more to see if I can make the promise/async stuff a bit better (the exportKey function in particular is hacky, but it was the only way I could get it to not complain for the time being - perhaps getting the e2e people to allow their exportKeyRing function to select only public key would be ideal in the long term).