executeAction_(callback, req) {
    var incoming = /** @type {!messages.ApiRequest.<string>} */ (req);
    var outgoing = {completedAction: incoming.action};

    // Ensure that only certain actions are exposed via the API.
    switch (incoming.action) {
      case constants.Actions.ENCRYPT_SIGN:
      case constants.Actions.DECRYPT_VERIFY:
        // Propagate the decryptPassphrase if needed.
        incoming.passphraseCallback = function(uid) {
          // Note: The passphrase needs to be known when calling executeAction_.
          return e2e.async.Result.toResult(incoming.decryptPassphrase || '');
        };
        break;
      default:
        outgoing.error = chrome.i18n.getMessage('errorUnsupportedAction');
        callback(outgoing);
        return;
    }

    if (window.launcher && !window.launcher.hasPassphrase()) {
      callback({error: chrome.i18n.getMessage('glassKeyringLockedError')});
      return;
    }

    if (!this.requestThrottle_.canProceed()) {
      outgoing.error = chrome.i18n.getMessage('throttleErrorMsg');
      callback(outgoing);
      return;
    }

    this.actionExecutor_.execute(
        incoming, this,
        function(resp) {
          outgoing.content = resp;
          callback(outgoing);
        },
        function(error) {
          outgoing.error = error.messageId !== undefined ?
              chrome.i18n.getMessage(error.messageId) :
              error.message;
          callback(outgoing);
        });
  }
Executes the PGP action and passed the result to the provided callback.
@param {function(*)} callback A callback to pass the result of the action
    to.
@param {*} req The execution request.
@private