PasswordAuthentication


PasswordAuthentication java.net

Java 1.2

This simple immutable class encapsulates a username and a password. The password is stored as a character array rather than as a String object so that the caller can erase the contents of the array after use for increased security. Note that the PasswordAuthentication( ) constructor clones the specified password character array, but getPassword( ) returns a reference to the object's internal array.

Application programmers defining an Authenticator object for their application need to create and return a PasswordAuthentication object from the getPasswordAuthentication( ) method of that object. System programmers writing URLStreamHandler implementations or otherwise interacting with a network server that requests password authentication may obtain a PasswordAutentication object representing the user 's name and password by calling the static Authenticator.requestPasswordAuthentication( ) method.

 public final class  PasswordAuthentication  {  // Public Constructors  public  PasswordAuthentication  (String  userName  , char[ ]  password  );  // Public Instance Methods  public char[ ]  getPassword  ( );        public String  getUserName  ( );   } 

Returned By

Authenticator.{getPasswordAuthentication( ) , requestPasswordAuthentication( )}



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net