1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-17 21:32:26 -05:00

Import/Export client certificate alias setting

This commit is contained in:
Joe Steele 2014-07-13 17:00:13 -04:00
parent ada74db8d5
commit 34fd6d3ea7
3 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ public class Settings {
* *
* @see SettingsExporter * @see SettingsExporter
*/ */
public static final int VERSION = 32; public static final int VERSION = 33;
public static Map<String, Object> validate(int version, Map<String, public static Map<String, Object> validate(int version, Map<String,
TreeMap<Integer, SettingsDescription>> settings, TreeMap<Integer, SettingsDescription>> settings,

View File

@ -61,6 +61,7 @@ public class SettingsExporter {
public static final String CONNECTION_SECURITY_ELEMENT = "connection-security"; public static final String CONNECTION_SECURITY_ELEMENT = "connection-security";
public static final String AUTHENTICATION_TYPE_ELEMENT = "authentication-type"; public static final String AUTHENTICATION_TYPE_ELEMENT = "authentication-type";
public static final String USERNAME_ELEMENT = "username"; public static final String USERNAME_ELEMENT = "username";
public static final String CLIENT_CERTIFICATE_ALIAS_ELEMENT = "client-cert-alias";
public static final String PASSWORD_ELEMENT = "password"; public static final String PASSWORD_ELEMENT = "password";
public static final String EXTRA_ELEMENT = "extra"; public static final String EXTRA_ELEMENT = "extra";
public static final String IDENTITIES_ELEMENT = "identities"; public static final String IDENTITIES_ELEMENT = "identities";
@ -232,6 +233,7 @@ public class SettingsExporter {
writeElement(serializer, CONNECTION_SECURITY_ELEMENT, incoming.connectionSecurity.name()); writeElement(serializer, CONNECTION_SECURITY_ELEMENT, incoming.connectionSecurity.name());
writeElement(serializer, AUTHENTICATION_TYPE_ELEMENT, incoming.authenticationType.name()); writeElement(serializer, AUTHENTICATION_TYPE_ELEMENT, incoming.authenticationType.name());
writeElement(serializer, USERNAME_ELEMENT, incoming.username); writeElement(serializer, USERNAME_ELEMENT, incoming.username);
writeElement(serializer, CLIENT_CERTIFICATE_ALIAS_ELEMENT, incoming.clientCertificateAlias);
// XXX For now we don't export the password // XXX For now we don't export the password
//writeElement(serializer, PASSWORD_ELEMENT, incoming.password); //writeElement(serializer, PASSWORD_ELEMENT, incoming.password);
@ -259,6 +261,7 @@ public class SettingsExporter {
writeElement(serializer, CONNECTION_SECURITY_ELEMENT, outgoing.connectionSecurity.name()); writeElement(serializer, CONNECTION_SECURITY_ELEMENT, outgoing.connectionSecurity.name());
writeElement(serializer, AUTHENTICATION_TYPE_ELEMENT, outgoing.authenticationType.name()); writeElement(serializer, AUTHENTICATION_TYPE_ELEMENT, outgoing.authenticationType.name());
writeElement(serializer, USERNAME_ELEMENT, outgoing.username); writeElement(serializer, USERNAME_ELEMENT, outgoing.username);
writeElement(serializer, CLIENT_CERTIFICATE_ALIAS_ELEMENT, outgoing.clientCertificateAlias);
// XXX For now we don't export the password // XXX For now we don't export the password
//writeElement(serializer, PASSWORD_ELEMENT, outgoing.password); //writeElement(serializer, PASSWORD_ELEMENT, outgoing.password);

View File

@ -976,6 +976,8 @@ public class SettingsImporter {
server.authenticationType = AuthType.valueOf(text); server.authenticationType = AuthType.valueOf(text);
} else if (SettingsExporter.USERNAME_ELEMENT.equals(element)) { } else if (SettingsExporter.USERNAME_ELEMENT.equals(element)) {
server.username = getText(xpp); server.username = getText(xpp);
} else if (SettingsExporter.CLIENT_CERTIFICATE_ALIAS_ELEMENT.equals(element)) {
server.clientCertificateAlias = getText(xpp);
} else if (SettingsExporter.PASSWORD_ELEMENT.equals(element)) { } else if (SettingsExporter.PASSWORD_ELEMENT.equals(element)) {
server.password = getText(xpp); server.password = getText(xpp);
} else if (SettingsExporter.EXTRA_ELEMENT.equals(element)) { } else if (SettingsExporter.EXTRA_ELEMENT.equals(element)) {