edu.vt.middleware.password
Class AbstractDigester

java.lang.Object
  extended by edu.vt.middleware.password.AbstractDigester
Direct Known Subclasses:
HistoryRule, SourceRule

public abstract class AbstractDigester
extends java.lang.Object

Provides common implementation for password rules that use a digest.

Version:
$Revision: 1926 $ $Date: 2011-04-26 15:52:24 -0400 (Tue, 26 Apr 2011) $
Author:
Middleware Services

Field Summary
protected  edu.vt.middleware.crypt.util.Converter converter
          Converter to use in conjunction with the digest.
protected  edu.vt.middleware.crypt.digest.DigestAlgorithm digest
          Digest object to use if comparing hashed passwords.
 
Constructor Summary
AbstractDigester()
           
 
Method Summary
protected  boolean matches(java.lang.String undigested, java.lang.String reference)
          Determines whether an undigested password matches a (possibly digested) reference value.
 void setDigest(java.lang.String algorithm, edu.vt.middleware.crypt.util.Converter conv)
          This will set the supplied digest algorithm to be used when password comparison are made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

digest

protected edu.vt.middleware.crypt.digest.DigestAlgorithm digest
Digest object to use if comparing hashed passwords.


converter

protected edu.vt.middleware.crypt.util.Converter converter
Converter to use in conjunction with the digest.

Constructor Detail

AbstractDigester

public AbstractDigester()
Method Detail

setDigest

public void setDigest(java.lang.String algorithm,
                      edu.vt.middleware.crypt.util.Converter conv)
This will set the supplied digest algorithm to be used when password comparison are made. Useful if you need to compare password which are in a hashed form. See DigestAlgorithm.

Parameters:
algorithm - to use for hashing
conv - to convert bytes to string

matches

protected boolean matches(java.lang.String undigested,
                          java.lang.String reference)
Determines whether an undigested password matches a (possibly digested) reference value.

Parameters:
undigested - candidate clear text password.
reference - reference password (possibly digested).
Returns:
true if passwords match, false otherwise.


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.