Top Description Fields Constructors Methods
java.net

public final Class PasswordAuthentication

extends Object
Class Inheritance

The class PasswordAuthentication is a data holder that is used by Authenticator. It is simply a repository for a user name and a password.
Author
Bill Foote
Since
1.2
See Also
java.net.Authenticator, java.net.Authenticator#getPasswordAuthentication()

Field Summary

Modifier and TypeField and Description
private final char[]
private final String

Constructor Summary

AccessConstructor and Description
public
PasswordAuthentication(String
the user name
userName
,
char[]
the user's password
password
)

Creates a new PasswordAuthentication object from the given user name and password.

Method Summary

Modifier and TypeMethod and Description
public char[]

Returns:

the password
getPassword
()

Returns the user password.

public String

Returns:

the user name
getUserName
()

Returns the user name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

passwordback to summary
private final char[] password
userNameback to summary
private final String userName

Constructor Detail

PasswordAuthenticationback to summary
public PasswordAuthentication(String userName, char[] password)

Creates a new PasswordAuthentication object from the given user name and password.

Note that the given user password is cloned before it is stored in the new PasswordAuthentication object.

Parameters
userName:String

the user name

password:char[]

the user's password

Method Detail

getPasswordback to summary
public char[] getPassword()

Returns the user password.

Note that this method returns a reference to the password. It is the caller's responsibility to zero out the password information after it is no longer needed.

Returns:char[]

the password

getUserNameback to summary
public String getUserName()

Returns the user name.

Returns:String

the user name