Class Password
java.lang.Object
org.eclipse.jetty.util.security.Credential
org.eclipse.jetty.util.security.Password
- All Implemented Interfaces:
Serializable
This password utility class obtains 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.eclipse.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.eclipse.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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Credential
Credential.Crypt, Credential.MD, Credential.MD5 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Credential
byteEquals, getCredential, stringEquals
-
Field Details
-
__OBFUSCATE
- See Also:
-
-
Constructor Details
-
Password
-
-
Method Details
-
toString
-
toStarString
-
check
Description copied from class:CredentialChecks the given credential against this credential instance.
- Specified by:
checkin classCredential- Parameters:
credentials- the credential to check against this instance. This may either be another Credential object; or a Password object; or a String, char[] or byte[] that are interpreted by this credential.- Returns:
- whether the given credentials match this credential instance
-
equals
-
hashCode
-
obfuscate
-
deobfuscate
-
getPassword
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.dft- The default password.promptDft- The default to use if prompting for the password.- Returns:
- Password
- Calling
-
main
- Throws:
IOException
-