public class Credentials extends Object implements Destroyable
| Modifier and Type | Class and Description |
|---|---|
static interface |
Credentials.Checker
Check some credentials with a given crypt.
|
| Constructor and Description |
|---|
Credentials() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Invalidate these credentials ;
act only on the password field.
|
static Credentials |
fromPassword(char[] password)
Create the credentials from a password.
|
static Credentials |
fromPassword(Password password)
Create the credentials from a password.
|
static Credentials |
fromUserPassword(String username,
char[] password)
Create the credentials from a user and a password.
|
static Credentials |
fromUserPassword(String username,
Password password)
Create the credentials from a user and a password.
|
<T> T |
get(String field)
Return a field value.
|
Password |
getPassword()
Return the password.
|
String |
getRealm()
Return the realm.
|
String |
getUserName()
Return the user name.
|
boolean |
isDestroyed() |
Credentials |
withField(String field,
Object data)
Append a custom field to this credentials.
|
Credentials |
withPassword(char[] password)
Append a password field to this credentials.
|
Credentials |
withPassword(Password password)
Append a password field to this credentials.
|
Credentials |
withRealm(String realm)
Append a realm field to this credentials.
|
Credentials |
withUser(String username)
Append a user name field to this credentials.
|
public static Credentials fromPassword(Password password)
password - The password.public static Credentials fromPassword(char[] password)
password - The password.public static Credentials fromUserPassword(String username, Password password)
username - The user name.password - The password.public static Credentials fromUserPassword(String username, char[] password)
username - The user name.password - The password.public Credentials withUser(String username)
username - The user name.public Credentials withPassword(Password password)
password - The password.public Credentials withPassword(char[] password)
password - The password.PasswordManagerFactory.getStrongPasswordManager()public Credentials withRealm(String realm)
realm - The realm.public Credentials withField(String field, Object data)
field - The field name.data - The field value.public String getUserName()
nullpublic Password getPassword()
nullpublic String getRealm()
nullpublic <T> T get(String field)
T - The type of the field.field - The field name.null.public void destroy()
destroy in interface Destroyablepublic boolean isDestroyed()
isDestroyed in interface DestroyableCopyright © 2018 Alternet. All rights reserved.