org.mortbay.util
Class Credential
java.lang.Object
org.mortbay.util.Credential
public abstract class Credential
extends java.lang.Object
Credentials.
The Credential class represents an abstract mechanism for checking
authentication credentials. A credential instance either represents a
secret, or some data that could only be derived from knowing the secret.
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.
$Id: Credential.java,v 1.7 2005/08/13 00:01:28 gregwilkins Exp $
abstract boolean | check(Object credentials) - Check a credential
|
static Credential | getCredential(String credential) - Get a credential from a String.
|
check
public abstract boolean check(Object credentials)
Check a 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.
- True if the credentials indicated that the shared secret is
known to both this Credential and the passed credential.
getCredential
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.
credential
- String representation of the credential
- A Credential or Password instance.
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.