use of org.eclipse.equinox.security.storage.ISecurePreferences in project arduino-eclipse-plugin by Sloeber.
the class PasswordManager method setLoginData.
/**
* Sets the login and password for a host
*
* @param host
* @param login
* @param password
* @throws Exception
*/
public void setLoginData(String host, String login, String password) throws Exception {
this.myhost = host;
this.myLogin = login;
this.myPassword = password;
String nodename = ConvertHostToNodeName(this.myhost);
ISecurePreferences root = SecurePreferencesFactory.getDefault();
ISecurePreferences node = root.node(nodename);
node.put(Messages.security_login, this.myLogin, false);
node.put(Messages.security_password, this.myPassword, true);
}
use of org.eclipse.equinox.security.storage.ISecurePreferences in project arduino-eclipse-plugin by Sloeber.
the class PasswordManager method ErasePassword.
public static void ErasePassword(String host) {
String nodename = ConvertHostToNodeName(host);
ISecurePreferences root = SecurePreferencesFactory.getDefault();
if (root.nodeExists(nodename)) {
ISecurePreferences node = root.node(nodename);
// (Messages.security_password, null, true);
node.removeNode();
}
}
use of org.eclipse.equinox.security.storage.ISecurePreferences in project linuxtools by eclipse.
the class RegistryAccountStorageManager method remove.
public void remove(final IRegistryAccount info) {
final ISecurePreferences preferences = getDockerNode();
final String key = getKeyFor(info);
preferences.remove(key);
}
use of org.eclipse.equinox.security.storage.ISecurePreferences in project linuxtools by eclipse.
the class RegistryAccountStorageManager method getDockerNode.
private ISecurePreferences getDockerNode() {
final ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
final ISecurePreferences dockerNode = preferences.node(// $NON-NLS-1$
"org.eclipse.linuxtools.docker.ui.accounts");
return dockerNode;
}
use of org.eclipse.equinox.security.storage.ISecurePreferences in project linuxtools by eclipse.
the class DockerConnection method storePassword.
private void storePassword(String uri, String username, String passwd) {
ISecurePreferences root = SecurePreferencesFactory.getDefault();
String key = DockerConnection.getPreferencesKey(uri, username);
ISecurePreferences node = root.node(key);
try {
if (// $NON-NLS-1$
passwd != null && !passwd.equals(""))
// $NON-NLS-1$
node.put("password", passwd, true);
} catch (StorageException e) {
Activator.log(e);
}
}
Aggregations