Class: Editor

Editor

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


new Editor(editorId)

Parameters:
Name Type Description
editorId String

the internal id of the editor

Source:

Methods


createDraft()

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.

Source:
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)

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

Parameters:
Name Type Description
recipients Array.<String>

list of email addresses for public key lookup and encryption

Source:
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..."
}