public class Credential
extends java.lang.Object
Credential
Modifier and Type | Field and Description |
---|---|
static int |
CERTIFICATE
Typecode for digital certificates.
|
static int |
PASSWORD
Typecode for passwords.
|
static int |
UNKNOWN
Typecode for unknown credentials.
|
Constructor and Description |
---|
Credential()
Creates a new credential.
|
Credential(int type,
java.lang.Object cred)
Creates a new credential with specified type and value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
check(java.lang.Object o)
Determines if the supplied value matches this one.
|
boolean |
check(java.lang.String pass)
Determines if the supplied password matches this
one.
|
boolean |
equals(Credential c)
Determines if two credentials are equal.
|
int |
getType()
Returns the type of this credential.
|
java.lang.String |
getTypeString()
Returns the type of this credential as a string.
|
static java.lang.String |
getTypeString(int type)
Returns the string name of the supplied type code.
|
java.lang.Object |
getValue()
Returns the value of this credential.
|
void |
setType(int credType)
Sets the type of this credential.
|
void |
setValue(java.lang.Object cred)
Sets the value of this credential.
|
java.lang.String |
toString() |
public static final int UNKNOWN
public static final int PASSWORD
public static final int CERTIFICATE
public Credential()
public Credential(int type, java.lang.Object cred)
type
- The type code (see above for the codes).cred
- The value of the credential.public void setType(int credType)
credType
- The typecode for this credential.public int getType()
public java.lang.String getTypeString()
public static java.lang.String getTypeString(int type)
type
- the type code.public void setValue(java.lang.Object cred)
cred
- The new value of the credential.public java.lang.Object getValue()
public boolean equals(Credential c)
public boolean check(java.lang.String pass)
pass
- Guess for the password.public boolean check(java.lang.Object o)
equals
message of the objects in
question.o
- Guess for the value of this credential.public java.lang.String toString()
toString
in class java.lang.Object