edu.wpi.prc.util.password
Class PasswordEraserThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.wpi.prc.util.password.PasswordEraserThread
All Implemented Interfaces:
java.lang.Runnable

public class PasswordEraserThread
extends java.lang.Thread

Erases the cleartext password typed by the user and replaces it with asterisks. NOTE: This implementation inspired by http://java.sun.com/developer/technicalArticles/Security/pwordmask/.

Author:
James Baldassari

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean isMasking
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PasswordEraserThread(java.lang.String prompt)
          Constructor that takes a password prompt.
 
Method Summary
 void run()
          Begins replacing characters with asterisks.
 void stopMasking()
          Stops replacing characters with asterisks.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isMasking

private volatile boolean isMasking
Constructor Detail

PasswordEraserThread

public PasswordEraserThread(java.lang.String prompt)
Constructor that takes a password prompt.

Parameters:
prompt - The password prompt to display.
Method Detail

run

public void run()
Begins replacing characters with asterisks.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopMasking

public void stopMasking()
Stops replacing characters with asterisks.