generateKey_(panel, name, email, comments, expDate) {
    var welcomePage = this;
    var anchorElem = this.genKeyForm_;
    var defaults = constants.KEY_DEFAULTS;
    utils.action.getContext(function(/** !e2e.openpgp.ContextImpl */ pgpCtx) {
      pgpCtx.isKeyRingEncrypted().addCallback(function(isEncrypted) {
        if (isEncrypted) {
          window.alert(chrome.i18n.getMessage('settingsKeyringLockedError'));
        }

        pgpCtx
            .generateKey(
                e2e.signer.Algorithm[defaults.keyAlgo], defaults.keyLength,
                e2e.cipher.Algorithm[defaults.subkeyAlgo],
                defaults.subkeyLength, name, comments, email, expDate)
            .addCallback(function(key) {
              var dialog = new dialogs.Generic(
                  chrome.i18n.getMessage('welcomeGenKeyConfirm'),
                  this.hideKeyringSetup_, dialogs.InputType.NONE);
              this.removeChild(this.genKeyForm_, false);
              this.addChild(dialog, false);
              dialog.decorate(this.genKeyForm_.getElement());
              panel.reset();
            }, this);
      }, this);
    }, this.displayFailure_, this);

    this.keyringMgmt_.refreshOptions();
  }
Generates a new PGP key using the information that is provided by the user.
@param {ui.panels.GenerateKey} panel The panel where the user has provided
    the information for the new key.
@param {string} name The name to use.
@param {string} email The email to use.
@param {string} comments The comments to use.
@param {number} expDate The expiration date to use.
@private