public boolean isPasswordAlias(String alias) { // Check if the passed string is specified using the alias syntax String aliasName = RelativePathResolver.getAlias(alias); return (aliasName != null); }
UnrecoverableKeyException { try { if (at == null || RelativePathResolver.getAlias(at) == null) { return ( at ); return (at); final String an = RelativePathResolver.getAlias(at); final PasswordAdapter pa = masterPasswordHelper.getMasterPasswordAdapter(); // use default password store final boolean exists = pa.aliasExists(an);
/** * Get SSH key passphrase from password file or user. */ String getSSHPassphrase(boolean verifyConn) throws CommandException { String passphrase = getFromPasswordFile("AS_ADMIN_SSHKEYPASSPHRASE"); if (passphrase != null) { String alias = RelativePathResolver.getAlias(passphrase); if (alias != null) passphrase = expandPasswordAlias(null, alias, verifyConn); } //get password from user if not found in password file if (passphrase == null) { if (programOpts.isInteractive()) { //i18n char[] pArr = readPassword(Strings.get("SSHPassphrasePrompt", getSshKeyFile())); passphrase = pArr != null ? new String(pArr) : null; } else { passphrase = ""; //empty passphrase } } return passphrase; }
/** * Get SSH password from password file or user. */ private String getRemotePassword(String node, String key) throws CommandException { String password = getFromPasswordFile(key); if (password != null) { String alias = RelativePathResolver.getAlias(password); if (alias != null) password = expandPasswordAlias(node, alias, true); } //get password from user if not found in password file if (password == null) { if (programOpts.isInteractive()) { char[] pArr = readPassword(Strings.get("SSHPasswordPrompt", getRemoteUser(), node)); password = pArr != null ? new String(pArr) : null; } else { throw new CommandException(Strings.get("SSHPasswordNotFound")); } } return password; }