/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A utility class for reading passwords
*
*/
public class Password {
/** Reads user password from given input stream. */
return readPassword(in, false);
}
/** Reads user password from given input stream.
* @param isEchoOn true if the password should be echoed on the screen
*/
throws IOException {
char[] consoleEntered = null;
byte[] consoleBytes = null;
try {
// Use the new java.io.Console class
// readPassword returns "" if you just print ENTER,
// to be compatible with old Password class, change to null
return null;
}
}
// Rest of the lines still necessary for KeyStoreLoginModule
// and when there is no console.
char[] lineBuffer;
char[] buf;
int i;
int offset = 0;
int c;
boolean done = false;
while (!done) {
case -1:
case '\n':
done = true;
break;
case '\r':
if (!(in instanceof PushbackInputStream)) {
}
} else {
done = true;
break;
}
default:
if (--room < 0) {
lineBuffer = buf;
}
break;
}
}
if (offset == 0) {
return null;
}
return ret;
} finally {
if (consoleEntered != null) {
}
if (consoleBytes != null) {
}
}
}
/**
* Change a password read from Console.readPassword() into
* its original bytes.
*
* @param pass a char[]
* @return its byte[] format, similar to new String(pass).getBytes()
*/
synchronized (Password.class) {
.charset()
.newEncoder()
}
}
synchronized (enc) {
}
}
return ba;
}
}