Index: network-manager-applet-0.9.8.8/src/wireless-security/eap-method-tls.c
===================================================================
--- network-manager-applet-0.9.8.8.orig/src/wireless-security/eap-method-tls.c	2013-11-11 15:41:44.000000000 +0100
+++ network-manager-applet-0.9.8.8/src/wireless-security/eap-method-tls.c	2014-07-09 12:44:09.261043481 +0200
@@ -53,6 +53,146 @@
 	gtk_entry_set_visibility (GTK_ENTRY (widget), visible);
 }
 
+void tls_view_hide_all(EAPMethod *method)
+{
+	GtkWidget *widget;
+	
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_user_cert_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_user_cert_button"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_button"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_ca_cert_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_ca_cert_button"));
+	gtk_widget_hide (widget);
+
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_engine_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_engine_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_module_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_module_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_key_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_key_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_cert_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_cert_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_ca_cert_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_ca_cert_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_pin_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_pin_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_password_label"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_password_entry"));
+	gtk_widget_hide (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "show_checkbutton_eaptls"));
+	gtk_widget_hide (widget);
+}
+
+void tls_view_pkcs11(EAPMethod *method)
+{
+	GtkWidget *widget;
+	gboolean secrets_only;
+
+	tls_view_hide_all(method);
+
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_identity_entry"));
+	secrets_only = !gtk_widget_is_sensitive (widget);
+
+	if (!secrets_only)
+	{
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_engine_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_engine_entry"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_module_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_module_entry"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_key_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_key_entry"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_cert_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_cert_entry"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_ca_cert_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_ca_cert_entry"));
+		gtk_widget_show (widget);
+	}
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_pin_label"));
+	gtk_widget_show (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_pkcs11_pin_entry"));
+	gtk_widget_show (widget);
+}
+
+void tls_view_file(EAPMethod *method)
+{
+	GtkWidget *widget;
+	gboolean secrets_only;
+	
+	tls_view_hide_all(method);
+
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_identity_entry"));
+	secrets_only = !gtk_widget_is_sensitive (widget);
+	
+	if (!secrets_only)
+	{
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_user_cert_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_user_cert_button"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_button"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_ca_cert_label"));
+		gtk_widget_show (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_ca_cert_button"));
+		gtk_widget_show (widget);
+	}
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_password_label"));
+	gtk_widget_show (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_private_key_password_entry"));
+	gtk_widget_show (widget);
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "show_checkbutton_eaptls"));
+	gtk_widget_show (widget);
+}
+
+static void
+keytype_toggled_cb (GtkRadioButton *button, EAPMethod *method)
+{
+	GtkWidget *widget;
+
+	widget = GTK_WIDGET (gtk_builder_get_object (method->builder, "eap_tls_keytype_file"));
+	g_assert (widget);
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+	{
+		tls_view_file(method);
+	}
+	else
+	{
+		tls_view_pkcs11(method);
+	}
+	/*wireless_security_changed_cb(button, method);*/
+}
+
 static gboolean
 validate (EAPMethod *parent)
 {
@@ -65,6 +205,13 @@
 	identity = gtk_entry_get_text (GTK_ENTRY (widget));
 	if (!identity || !strlen (identity))
 		return FALSE;
+	
+	/* PKCS11: no additionnal checks for the moment */
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_pkcs11"));
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+	{
+		return TRUE;
+	}
 
 	if (!eap_method_validate_filepicker (parent->builder, "eap_tls_ca_cert_button", TYPE_CA_CERT, NULL, NULL))
 		return FALSE;
@@ -124,7 +271,9 @@
 	NMSetting8021x *s_8021x;
 	GtkWidget *widget;
 	char *ca_filename, *pk_filename, *cc_filename;
-	const char *password = NULL;
+	const char *password = NULL, *text = NULL;
+    char *path = NULL;
+    GSettings *settings;
 	GError *error = NULL;
 	const char *secret_flag_prop = NULL;
 
@@ -139,6 +288,66 @@
 	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_identity_entry"));
 	g_assert (widget);
 	g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (GTK_ENTRY (widget)), NULL);
+	/* set PKCS11 properties */
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_pkcs11"));
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+	{
+		g_object_set (G_OBJECT(s_8021x), "engine", TRUE, NULL);
+
+		/* ugly hack to silence the CA warning before we find a better way */
+		path = g_strdup_printf ("/org/gnome/nm-applet/eap/%s", nm_connection_get_uuid (connection));
+		settings = g_settings_new_with_path ("org.gnome.nm-applet.eap", path);
+		g_free (path);
+		g_settings_set_boolean (settings, "ignore-ca-cert", TRUE);
+		g_settings_set_boolean (settings, "ignore-phase2-ca-cert", TRUE);
+
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_pin_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text && strlen(text) >= 1)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_PIN, text, NULL);
+		}
+
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_key_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_KEY_ID, text, NULL);
+		}
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_cert_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_CERT_ID, text, NULL);
+		}
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_ca_cert_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text && strlen(text) > 0)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_CA_CERT_ID, text, NULL);
+		}
+		else
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_CA_CERT_ID, NULL, NULL);
+		}
+
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_engine_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_PKCS11_ENGINE_PATH, text, NULL);
+		}
+		
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_module_entry"));
+		text = gtk_entry_get_text (GTK_ENTRY (widget));
+		if (text)
+		{
+			g_object_set (s_8021x, NM_SETTING_802_1X_PKCS11_MODULE_PATH, text, NULL);
+		}
+
+		return;
+	}
+	g_object_set (G_OBJECT(s_8021x), "engine", FALSE, NULL);
 
 	/* TLS private key */
 	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_private_key_password_entry"));
@@ -384,6 +593,7 @@
 	}
 }
 
+
 EAPMethodTLS *
 eap_method_tls_new (WirelessSecurity *ws_parent,
                     NMConnection *connection,
@@ -394,6 +604,7 @@
 	EAPMethod *parent;
 	GtkWidget *widget;
 	NMSetting8021x *s_8021x = NULL;
+    gchar *text;
 
 	parent = eap_method_init (sizeof (EAPMethodTLS),
 	                          validate,
@@ -458,22 +669,94 @@
 	g_signal_connect (G_OBJECT (widget), "toggled",
 	                  (GCallback) show_toggled_cb,
 	                  parent);
+	
+	/* PKCS 11 handling */	
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_file"));
+	g_assert (widget);
+	g_signal_connect (G_OBJECT (widget), "toggled",
+	                  (GCallback) keytype_toggled_cb,
+	                  parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_pkcs11"));
+	g_assert (widget);
+	g_signal_connect (G_OBJECT (widget), "toggled",
+	                  (GCallback) keytype_toggled_cb,
+	                  parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_key_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_cert_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_ca_cert_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_pin_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_module_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
+	widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_engine_entry"));
+	g_signal_connect (G_OBJECT (widget), "changed",
+	                  (GCallback) wireless_security_changed_cb,
+	                  ws_parent);
 
 	if (secrets_only) {
 		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_identity_entry"));
 		gtk_widget_set_sensitive (widget, FALSE);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_user_cert_label"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_user_cert_button"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_private_key_label"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_private_key_button"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_ca_cert_label"));
-		gtk_widget_hide (widget);
-		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_ca_cert_button"));
-		gtk_widget_hide (widget);
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_pkcs11"));
+		gtk_widget_set_sensitive (widget, FALSE);
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_file"));
+		gtk_widget_set_sensitive (widget, FALSE);
+	}
+	/* set TLS type */
+	if (nm_setting_802_1x_get_engine(s_8021x))
+	{
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_pkcs11"));
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
+		tls_view_pkcs11(parent);
+		/* fill in PKCS11 info */
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_key_entry"));
+        text = nm_setting_802_1x_get_key_id (s_8021x);
+        if (text)
+        {
+            gtk_entry_set_text (GTK_ENTRY (widget), text);
+        }
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_cert_entry"));
+        text = nm_setting_802_1x_get_cert_id (s_8021x);
+        if (text)
+        {
+		    gtk_entry_set_text (GTK_ENTRY (widget), text);
+        }
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_ca_cert_entry"));
+        text = nm_setting_802_1x_get_ca_cert_id (s_8021x);
+        if (text)
+        {
+		    gtk_entry_set_text (GTK_ENTRY (widget), text);
+        }
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_engine_entry"));
+        text = nm_setting_802_1x_get_pkcs11_engine_path (s_8021x);
+        if (text)
+        {
+		    gtk_entry_set_text (GTK_ENTRY (widget), text);
+        }
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_pkcs11_module_entry"));
+        text = nm_setting_802_1x_get_pkcs11_module_path (s_8021x);
+        if (text)
+        {
+		    gtk_entry_set_text (GTK_ENTRY (widget), text);
+        }
+	}
+	else
+	{
+		widget = GTK_WIDGET (gtk_builder_get_object (parent->builder, "eap_tls_keytype_file"));
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
+		tls_view_file(parent);
 	}
 
 	return method;
Index: network-manager-applet-0.9.8.8/src/wireless-security/eap-method-tls.ui
===================================================================
--- network-manager-applet-0.9.8.8.orig/src/wireless-security/eap-method-tls.ui	2013-11-11 15:41:44.000000000 +0100
+++ network-manager-applet-0.9.8.8/src/wireless-security/eap-method-tls.ui	2014-07-08 15:21:35.000000000 +0200
@@ -1,187 +1,450 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.6 -->
-  <!-- interface-naming-policy toplevel-contextual -->
-      <object class="GtkNotebook" id="eap_tls_notebook">
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkNotebook" id="eap_tls_notebook">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="show_tabs">False</property>
+    <property name="show_border">False</property>
+    <child>
+      <object class="GtkTable" id="table8">
         <property name="visible">True</property>
-        <property name="show_tabs">False</property>
-        <property name="show_border">False</property>
+        <property name="can_focus">False</property>
+        <property name="n_rows">14</property>
+        <property name="n_columns">2</property>
+        <property name="column_spacing">12</property>
+        <property name="row_spacing">6</property>
         <child>
-          <object class="GtkTable" id="table8">
+          <object class="GtkLabel" id="eap_tls_identity_label">
             <property name="visible">True</property>
-            <property name="n_rows">6</property>
-            <property name="n_columns">2</property>
-            <property name="column_spacing">12</property>
-            <property name="row_spacing">6</property>
-            <child>
-              <object class="GtkLabel" id="eap_tls_identity_label">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">I_dentity:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">eap_tls_identity_entry</property>
-              </object>
-              <packing>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="eap_tls_identity_entry">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="activates_default">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="eap_tls_user_cert_label">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">_User certificate:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">eap_tls_user_cert_button</property>
-              </object>
-              <packing>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="eap_tls_ca_cert_label">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">C_A certificate:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">eap_tls_ca_cert_button</property>
-              </object>
-              <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFileChooserButton" id="eap_tls_ca_cert_button">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="eap_tls_private_key_label">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Private _key:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">eap_tls_private_key_button</property>
-              </object>
-              <packing>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFileChooserButton" id="eap_tls_private_key_button">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="eap_tls_private_key_password_label">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">_Private key password:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">eap_tls_private_key_password_entry</property>
-              </object>
-              <packing>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEntry" id="eap_tls_private_key_password_entry">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="visibility">False</property>
-                <property name="activates_default">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkCheckButton" id="show_checkbutton_eaptls">
-                <property name="label" translatable="yes">Sho_w password</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-                <property name="draw_indicator">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkFileChooserButton" id="eap_tls_user_cert_button">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">I_dentity:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_identity_entry</property>
           </object>
+          <packing>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_identity_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="activates_default">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="show_checkbutton_eaptls">
+            <property name="label" translatable="yes">Sho_w password</property>
+            <property name="use_action_appearance">False</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_action_appearance">False</property>
+            <property name="use_underline">True</property>
+            <property name="xalign">0.5</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">7</property>
+            <property name="bottom_attach">8</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_private_key_password_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="visibility">False</property>
+            <property name="activates_default">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="y_options"/>
+          </packing>
         </child>
-        <child type="tab">
-          <object class="GtkLabel" id="label34">
+        <child>
+          <object class="GtkLabel" id="eap_tls_private_key_password_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">_Private key password:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_private_key_password_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFileChooserButton" id="eap_tls_private_key_button">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">5</property>
+            <property name="bottom_attach">6</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options">GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_private_key_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Private _key:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_private_key_button</property>
+          </object>
+          <packing>
+            <property name="top_attach">5</property>
+            <property name="bottom_attach">6</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFileChooserButton" id="eap_tls_ca_cert_button">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
           </object>
           <packing>
-            <property name="tab_fill">False</property>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">4</property>
+            <property name="bottom_attach">5</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options">GTK_FILL</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_ca_cert_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">C_A certificate:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_ca_cert_button</property>
+          </object>
+          <packing>
+            <property name="top_attach">4</property>
+            <property name="bottom_attach">5</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFileChooserButton" id="eap_tls_user_cert_button">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options">GTK_FILL</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_user_cert_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">_User certificate:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_user_cert_button</property>
+          </object>
+          <packing>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_pin_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">13</property>
+            <property name="bottom_attach">14</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_keytype_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">TLS key type:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_keytype_file</property>
+          </object>
+          <packing>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="eap_tls_keytype_file">
+            <property name="label" translatable="yes">file</property>
+            <property name="use_action_appearance">False</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_action_appearance">False</property>
+            <property name="xalign">0</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+            <property name="group">eap_tls_keytype_pkcs11</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRadioButton" id="eap_tls_keytype_pkcs11">
+            <property name="label" translatable="yes">PKCS11</property>
+            <property name="use_action_appearance">False</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="use_action_appearance">False</property>
+            <property name="xalign">0</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_engine_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 engine:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_engine_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">8</property>
+            <property name="bottom_attach">9</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_engine_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">8</property>
+            <property name="bottom_attach">9</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_module_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">9</property>
+            <property name="bottom_attach">10</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_module_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 module:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_module_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">9</property>
+            <property name="bottom_attach">10</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_pin_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 pin code:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_pin_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">13</property>
+            <property name="bottom_attach">14</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_key_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 key id:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_key_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">10</property>
+            <property name="bottom_attach">11</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_key_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">10</property>
+            <property name="bottom_attach">11</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_cert_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 cert id:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_cert_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">11</property>
+            <property name="bottom_attach">12</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_cert_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">11</property>
+            <property name="bottom_attach">12</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <object class="GtkEntry" id="eap_tls_pkcs11_ca_cert_entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="invisible_char">●</property>
+            <property name="activates_default">True</property>
+            <property name="invisible_char_set">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
+            <property name="top_attach">12</property>
+            <property name="bottom_attach">13</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="eap_tls_pkcs11_ca_cert_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">PKCS11 CA cert id:</property>
+            <property name="use_underline">True</property>
+            <property name="mnemonic_widget">eap_tls_pkcs11_ca_cert_entry</property>
+          </object>
+          <packing>
+            <property name="top_attach">12</property>
+            <property name="bottom_attach">13</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"/>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child type="tab">
+      <object class="GtkLabel" id="label34">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
       </object>
+      <packing>
+        <property name="tab_fill">False</property>
+      </packing>
+    </child>
+  </object>
 </interface>
