public class PasswordCredentials extends Object implements LoginCredentials, Serializable
Constructor and Description |
---|
PasswordCredentials(String username,
char[] password)
Creates a username/password credential set.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Wipes out the password storage to ensure it does not hang around in
in the Java VM memory space.
|
char[] |
getPassword()
Gets the password.
|
String |
getUsername()
Identifies the user owning the credentials.
|
public PasswordCredentials(String username, char[] password) throws IllegalArgumentException
clear()
method when you are done with the
object to avoid have the password being present in the Java memory heap.username
- the name of the userpassword
- the password of the userIllegalArgumentException
- if either username or password
have null values.public String getUsername()
LoginCredentials
getUsername
in interface LoginCredentials
LoginCredentials.getUsername()
public char[] getPassword()
public void clear()
Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.