Editor

Not accessible, instance can be obtained using Mailvelope#createEditorContainer.

Constructor

new Editor(editorId)

Parameters:
NameTypeDescription
editorIdString

the internal id of the editor

Methods

createDraft() → {Promise.<AsciiArmored, Error>}

Encrypt and sign the content of the editor with the default key of the user.
To be used to save drafts. To restore drafts use the options.armoredDraft parameter of the createEditorContainer method.

Throws:

error.code = 'ENCRYPT_IN_PROGRESS'

error.code = 'NO_KEY_FOR_ENCRYPTION'

error.code = 'ENCRYPT_QUOTA_SIZE'

Type
Error
Returns:
Type: 
Promise.<AsciiArmored, Error>

encrypt(recipients) → {Promise.<AsciiArmored, Error>}

Requests the encryption of the editor content for the given recipients.

Parameters:
NameTypeDescription
recipientsArray.<String>

list of email addresses for public key lookup and encryption

Throws:

error.code = 'ENCRYPT_IN_PROGRESS'

error.code = 'NO_KEY_FOR_RECIPIENT'

error.code = 'ENCRYPT_QUOTA_SIZE'

Type
Error
Returns:
Type: 
Promise.<AsciiArmored, Error>
Example
editor.encrypt(['abc@web.de', 'info@com']).then(function (armoredMessage) {
    console.log('encrypt', armoredMessage); // prints: "-----BEGIN PGP MESSAGE..."
});