| java.lang.Object org.mortbay.jetty.security.Credential org.mortbay.jetty.security.Password
Password | public class Password extends Credential (Code) | | Password utility class.
This utility class gets a password or pass phrase either by:
+ Password is set as a system property.
+ The password is prompted for and read from standard input
+ A program is run to get the password.
Passwords that begin with OBF: are de obfuscated.
Passwords can be obfuscated by run org.mortbay.util.Password as a
main class. Obfuscated password are required if a system needs
to recover the full password (eg. so that it may be passed to another
system). They are not secure, but prevent casual observation.
Passwords that begin with CRYPT: are oneway encrypted with
UnixCrypt. The real password cannot be retrieved, but comparisons
can be made to other passwords. A Crypt can be generated by running
org.mortbay.util.UnixCrypt as a main class, passing password and
then the username. Checksum passwords are a secure(ish) way to
store passwords that only need to be checked rather
than recovered. Note that it is not strong security - specially if
simple passwords are used.
author: Greg Wilkins (gregw) |
Password | public Password(String password)(Code) | | Constructor.
Parameters: password - The String password. |
getPassword | public static Password getPassword(String realm, String dft, String promptDft)(Code) | | Get a password.
A password is obtained by trying
- Calling
System.getProperty(realm,dft)
- Prompting for a password
- Using promptDft if nothing was entered.
Parameters: realm - The realm name for the password, used as a SystemProperty name. Parameters: dft - The default password. Parameters: promptDft - The default to use if prompting for the password. Password |
hashCode | public int hashCode()(Code) | | |
main | public static void main(String[] arg)(Code) | | Parameters: arg - |
|
|