@Override public String getPassphrase() { String prompt = String.format("identity passphrase: "); char[] password = Contexts.passwordPrompt(prompt); // THIS IS UNFORTUNATE SINCE THIS STRING IS INTERNED... return new String(password); }
@Override public String getPassword() { // pass along password if provided (but only one time!) if (JschConnect.this.uri.getPassword() != null) { if (this.returnedPassword) { // prevent possible infinite loop! throw new IllegalStateException("Password prompted too many times"); } this.returnedPassword = true; return JschConnect.this.uri.getPassword(); } // joelauer@hosts's password: String prompt = String.format("%1s@%2s's password: ", jschSession.getUserName(), jschSession.getHost()); char[] password = Contexts.passwordPrompt(prompt); // THIS IS UNFORTUNATE SINCE THIS STRING IS INTERNED... return new String(password); }