[RCD] Accessing Mailvelope Keyring

Thomas Bruederli thomas at roundcube.net
Mon Jul 11 10:34:33 CEST 2016


On Sat, Jul 9, 2016 at 12:29 AM, Kyle Francis <franck6 at rpi.edu> wrote:
> I just started playing around with the Mailvelope support in v1.2 and I it
> looks quite nice.  I wasn't aware that Mailvelope now supports adding
> attachements and that was a pleasant surprise.
>
> In attempting to implement the hybrid PGP decryption model (decrypting the
> session key in the client and passing the session key back to the server for
> full decryption) I was hoping to tap into the mailvelope keyring as I figure
> it will be more secure in terms of storage than attempting to write my own
> using openpgp.js.  I see where mailvelope is loaded in app.js and "this"
> refers to an instance of rcube_webmail.  However, from the plugin space
> (i.e. enigma.js) the "this" class is of type rcmail and notably "this" does
> not contain the previously initialized "mailvelope_keyring".

this should always refer to the instance of rcube_webmail which is
also exposed in a global variable (in window scope) named 'rcmail'.

enigma.js is build in a way that it extends the rcube_webmail
prototype which in turn means that you have the same global instance
of rcube_webmail in 'this'. Therefore I don't fully understand what
problems you're running into. Maybe you can give us some more concrete
hints in terms of file names and line numbers.

> Since my javascript fu is not as strong as my php fu, would anyone be able
> to point me in the right direction of how to access the mailvelope_keyring
> from inside the plugin space, specifically enigma.js?

window.rcmail is what you're looking for.mailing list

~Thomas


More information about the dev mailing list