new Mailvelope()
- Source
Methods
createDisplayContainer(selector, armored, keyringopt, options) → {Promise.<DisplayContainer, Error>}
Creates an iframe to display the decrypted content of the encrypted mail.
The iframe will be injected into the container identified by selector.
| Name | Type | Attributes | Description |
|---|---|---|---|
selector | CssSelector | target container | |
armored | AsciiArmored | the encrypted mail to display | |
keyring | Keyring | <optional> | the keyring to use for this operation |
options | DisplayContainerOptions |
- Source
- Type:
- Promise.<DisplayContainer, Error>
createEditorContainer(selector, keyringopt, options) → {Promise.<Editor, Error>}
Creates an iframe with an editor for a new encrypted mail.
The iframe will be injected into the container identified by selector.
| Name | Type | Attributes | Description |
|---|---|---|---|
selector | CssSelector | target container | |
keyring | Keyring | <optional> | the keyring to use for this operation |
options | EditorContainerOptions |
- Source
error.code = 'WRONG_ARMORED_TYPE' - parameters of type AsciiArmored do not have the correct armor type
error.code = 'INVALID_OPTIONS' - invalid combination of options parameter- Type
- Error
- Type:
- Promise.<Editor, Error>
mailvelope.createEditorContainer('#editor-element', keyring).then(function(editor) {
// register event handler for mail client send button
$('#mailer-send').click(function() {
// encrypt current content of editor for array of recipients
editor.encrypt(['info@mailvelope.com', 'abc@web.de']).then(function(armored) {
console.log('encrypted message', armored);
});
});
});createEncryptedFormContainer(selector, formHtml, signature) → {Promise.<Object, Error>}
Creates an iframe to display an encrypted form
The iframe will be injected into the container identified by selector.
| Name | Type | Description |
|---|---|---|
selector | CssSelector | target container |
formHtml | String | the form definition |
signature | AsciiArmored | the OpenPGP signature over the form definition |
- Source
error.code = 'INVALID_FORM' the form definition is not valid
- Type
- Error
an object that includes armoredData
- Type:
- Promise.<Object, Error>
createKeyring(identifier) → {Promise.<Keyring, Error>}
Creates a Keyring for the given identifier
| Name | Type | Description |
|---|---|---|
identifier | String | the identifier of the new keyring |
- Source
error.code = 'KEYRING_ALREADY_EXISTS'
- Type
- Error
- Type:
- Promise.<Keyring, Error>
mailvelope.createKeyring('Account-ID-4711').then(function(keyring) {
// continue to display the settings container and start the setup wizard
mailvelope.createSettingsContainer('#mailvelope-settings', keyring);
});createSettingsContainer(selector, keyringopt, options) → {Promise.<undefined, Error>}
Creates an iframe to display the keyring settings.
The iframe will be injected into the container identified by selector.
| Name | Type | Attributes | Description |
|---|---|---|---|
selector | CssSelector | target container | |
keyring | Keyring | <optional> | the keyring to use for the setup |
options | SettingsContainerOptions |
- Deprecated
- since v6.1.0 - use keyring.openSettings() instead
- Source
- Type:
- Promise.<undefined, Error>
getKeyring(identifier) → {Promise.<Keyring, Error>}
Retrieves the Keyring for the given identifier
| Name | Type | Description |
|---|---|---|
identifier | String | the identifier of the keyring, if empty the main keyring is returned |
- Source
error.code = 'NO_KEYRING_FOR_ID'
- Type
- Error
- Type:
- Promise.<Keyring, Error>
getVersion() → {Promise.<String, Error>}
Gives access to the mailvelope extension version
- Source
- Type:
- Promise.<String, Error>