Hey, > We are currently redesigning the high level API in the devel branch. > Like in the current version of OpenPGP.js it's a synchronous API.
The OpenPGP.js API can stay synchronous/blocking for single encryptionoperations. It's just important that we are able to load modules selectively if we need a worker thread. For example, when decrypting 10 large email in an application, I don't want OpenPGP.js to start a worker thread for each email (which it would to if we put the worker logic behind an async Api). But rather I would like to batch that workload in the application level, since starting up a web worker a cost of itself (loading files from disk etc). > A future proof high-level API in the devel branch would be flexible enough > to incorporate all these different requirements. This is a complex Problem. I'm thinking it would make sense to offer an async Api for keygen. Here's how forge does it: https://github.com/digitalbazaar/forge#rsa > I'm thinking of a setup where we have > different configurations for build targets (like standard, web worker, > web crypto) > and can replace single modules in the configuration but at all time test > against > all targets. > > Does that make sense and can this be achieved with AMD? Yes. That's precicly what I mean by Require.js being more flexible. Require.js supports web workers out of the box: http://requirejs.org/docs/api.html#webworker For simple deployments where I only want to drop in a single openpgp.js file, we can offer a build: http://requirejs.org/docs/optimization.html#onejs In fact, browserfiy actually used require.js' build system internally ;) Tankred _______________________________________________ http://openpgpjs.org Subscribe/unsubscribe: http://list.openpgpjs.org

