public class SimpleUserInfo extends Object implements UserInfo
UserInfo implementation that always returns the same passphrase and password.
It will not show any messages, and promptYesNo(String) will always return false.
That means that it will not prompt if the authenticity of a host cannot be established, but will automatically answer the question with "no".
Make sure to use a HostKeyRepository that can verify the host automatically.| Constructor and Description |
|---|
SimpleUserInfo(char[] password)
Creates a new
SimpleUserInfo object with no passphrase. |
SimpleUserInfo(String passphrase,
char[] password)
Creates a new
SimpleUserInfo object. |
| Modifier and Type | Method and Description |
|---|---|
String |
getPassphrase() |
String |
getPassword() |
boolean |
promptPassphrase(String message) |
boolean |
promptPassword(String message) |
boolean |
promptYesNo(String message) |
void |
showMessage(String message) |
public SimpleUserInfo(char[] password)
SimpleUserInfo object with no passphrase.password - The password to use.NullPointerException - If the password is null.public SimpleUserInfo(String passphrase, char[] password)
SimpleUserInfo object.passphrase - The passphrase to use.password - The password to use.NullPointerException - If the password is null.public String getPassphrase()
getPassphrase in interface UserInfopublic String getPassword()
getPassword in interface UserInfopublic boolean promptPassword(String message)
promptPassword in interface UserInfopublic boolean promptPassphrase(String message)
promptPassphrase in interface UserInfopublic boolean promptYesNo(String message)
promptYesNo in interface UserInfopublic void showMessage(String message)
showMessage in interface UserInfoCopyright © 2016–2025. All rights reserved.