Often a Credential is related to a Password via a one way algorithm, so while a Password itself is a Credential, a UnixCrypt or MD5 digest of a a password is only a credential that can be checked against the password.
This class includes an implementation for unix Crypt an MD5 digest.
Password
| Modifier and Type | Class and Description |
|---|---|
| public static class | Credential.Crypt
Unix Crypt Credentials |
| public static class | Credential.MD5
MD5 Credentials |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: True if the credentials indicated that the shared secret is known to both this Credential and the passed credential.The credential to check against. This may either be
another Credential object, a Password object or a String which is
interpreted by this credential. credentials)Check a credential |
| public static Credential | Returns: A Credential or Password instance.String representation of the credential credential)Get a credential from a String. |
| Credential | back to summary |
|---|---|
| public Credential() | |
| check | back to summary |
|---|---|
| public abstract boolean check(Object credentials) Check a credential
| |
| getCredential | back to summary |
|---|---|
| public static Credential getCredential(String credential) Get a credential from a String. If the credential String starts with a known Credential type (eg "CRYPT:" or "MD5:" ) then a Credential of that type is returned. Else the credential is assumed to be a Password.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | check(Object
The credential to check against. This may either be
another Credential object, a Password object or a String which is
interpreted by this credential. credentials)Implements abstract org. |
| public static String |
| __TYPE | back to summary |
|---|---|
| public static final String __TYPE | |
| _cooked | back to summary |
|---|---|
| private String _cooked | |
| Crypt | back to summary |
|---|---|
| pack-priv Crypt(String cooked) | |
| check | back to summary |
|---|---|
| public boolean check(Object credentials) Implements abstract org. Doc from org. Check a credential
| |
| crypt | back to summary |
|---|---|
| public static String crypt(String user, String pw) | |
| Modifier and Type | Field and Description |
|---|---|
| private static MessageDigest | |
| public static final Object | |
| public static final String | |
| private byte[] |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | check(Object
The credential to check against. This may either be
another Credential object, a Password object or a String which is
interpreted by this credential. credentials)Implements abstract org. |
| public static String | |
| public byte[] |
| __md | back to summary |
|---|---|
| private static MessageDigest __md | |
| __md5Lock | back to summary |
|---|---|
| public static final Object __md5Lock | |
| __TYPE | back to summary |
|---|---|
| public static final String __TYPE | |
| _digest | back to summary |
|---|---|
| private byte[] _digest | |
| MD5 | back to summary |
|---|---|
| pack-priv MD5(String digest) | |
| check | back to summary |
|---|---|
| public boolean check(Object credentials) Implements abstract org. Doc from org. Check a credential
| |
| digest | back to summary |
|---|---|
| public static String digest(String password) | |
| getDigest | back to summary |
|---|---|
| public byte[] getDigest() | |