public class Password extends Credential
+ 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.
Credential.Crypt, Credential.MD5
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
__OBFUSCATE |
Constructor and Description |
---|
Password(java.lang.String password)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(java.lang.Object credentials)
Check a credential
|
static java.lang.String |
deobfuscate(java.lang.String s) |
boolean |
equals(java.lang.Object o) |
static Password |
getPassword(java.lang.String realm,
java.lang.String dft,
java.lang.String promptDft)
Get a password.
|
int |
hashCode() |
static void |
main(java.lang.String[] arg) |
static java.lang.String |
obfuscate(java.lang.String s) |
java.lang.String |
toStarString() |
java.lang.String |
toString() |
getCredential
public static final java.lang.String __OBFUSCATE
public Password(java.lang.String password)
password
- The String password.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStarString()
public boolean check(java.lang.Object credentials)
Credential
check
in class Credential
credentials
- The credential to check against. This may either be another Credential object, a Password object or a String which is interpreted by this
credential.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.lang.String obfuscate(java.lang.String s)
public static java.lang.String deobfuscate(java.lang.String s)
public static Password getPassword(java.lang.String realm, java.lang.String dft, java.lang.String promptDft)
System.getProperty(realm,dft)
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.public static void main(java.lang.String[] arg)
Copyright © 2010 - 2019 Adobe. All Rights Reserved