code: private void setActiveAction() {
  		int ks = keyStoreList.getSelectedIndex();
  		int alias = aliasTable.getSelectedRow();
  		if (ks > -1 && alias>-1) {
  			if (!contextManager.isKeyUnlocked(ks, alias)) {
  
  
  				try {
  					if(!contextManager.unlockKeyWithDefaultPassword(ks, alias)){
  						String password = getPassword();
  
  						if(!contextManager.unlockKey(ks, alias, password)){
  							JOptionPane.showMessageDialog(null, new String[] {
  									Constant.messages.getString("options.cert.error.accesskeystore")}, 
  									Constant.messages.getString("options.cert.error"), JOptionPane.ERROR_MESSAGE);
  						}
  					}
  				} catch (Exception e) {
  					showKeyStoreCertError(e.toString());
  				}
  			}
  			Certificate cert = contextManager.getCertificate(ks, alias);
  			try {
  				contextManager.getFingerPrint(cert);
  			} catch (KeyStoreException kse) {
  				showCertError("options.cert.error.fingerprint", kse.toString());
  			}
  
  			try {
  				contextManager.setDefaultKey(ks, alias);
  
  				OptionsParamCertificate certParam = Model.getSingleton().getOptionsParam().getCertificateParam();
  				certParam.setActiveCertificate();
  
  			} catch (KeyStoreException e) {
  				logger.error(e.getMessage(), e);
  			}
  			certificateTextField.setText(contextManager.getDefaultKey());
  		}
  	}
docs: GEN-LAST:event_setActiveButtonActionPerformed