## org.beepcore.beep.profile.sasl.otp.database
Class UserDatabaseImpl

    java.lang.Object
      org.beepcore.beep.profile.sasl.otp.database.UserDatabaseImpl

All Implemented Interfaces:
  UserDatabase

public class UserDatabaseImpl
extends java.lang.Object
implements UserDatabase

This class is an implementation of UserDatabase interface. It uses the java.util.Property class, which uses the local filesystem, to store SASL OTP user databases.

Method Summary
`java.lang.String` `getAlgorithmName()` Method getAlgorithmName
`java.lang.String` `getAuthenticator()` Method getLastHash
`byte[]` `getLastHash()` Method getLastHash
`java.lang.String` `getLastHashAsString()` Method getLastHash
`java.lang.String` `getSeed()` Method getLastHash
`int` `getSequence()` Method getLastHash
`void` `updateLastHash(java.lang.String hash)` Method updateLastHash

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getAlgorithmName

    public java.lang.String getAlgorithmName()

  Method getAlgorithmName

  Specified by:
    `getAlgorithmName` in interface `UserDatabase`
  Returns:
    String the algorithm employed by the user of this database for SASL OTP authentication.

### getLastHash

    public byte[] getLastHash()
                       throws SASLException

  Method getLastHash

  Specified by:
    `getLastHash` in interface `UserDatabase`
  Returns:
    byte[] the lastHash value generated the last time the user of this database performed SASL OTP authentication. The hash value is represented in binary form.
  Throws:
    `SASLException`

### getLastHashAsString

    public java.lang.String getLastHashAsString()

  Method getLastHash

  Specified by:
    `getLastHashAsString` in interface `UserDatabase`
  Returns:
    String the lastHash value generated the last time the user of this database performed SASL OTP authentication. The hash is represented in hexadecimal form.

### getSeed

    public java.lang.String getSeed()

  Method getLastHash

  Specified by:
    `getSeed` in interface `UserDatabase`
  Returns:
    String the seed used by the user of this database for SASL OTP authentication.

### getSequence

    public int getSequence()

  Method getLastHash

  Specified by:
    `getSequence` in interface `UserDatabase`
  Returns:
    int the sequence that should be used by the user of this database for their next SASL OTP authentication.

### getAuthenticator

    public java.lang.String getAuthenticator()

  Method getLastHash

  Specified by:
    `getAuthenticator` in interface `UserDatabase`
  Returns:
    String the last hash value used by the user of this database for SASL OTP authentication.

### updateLastHash

    public void updateLastHash(java.lang.String hash)
                        throws SASLException

  Method updateLastHash

  Specified by:
    `updateLastHash` in interface `UserDatabase`
  Parameters:
    `hash` - String is the new hash value to be stored in the user database, for use in comparison the next time they try to authenticate.
  Throws:
    `SASLException` - in the event that the update causes an exception to be thrown during the OTP database update.

Copyright ? 2001 Invisible Worlds, Inc. All Rights Reserved.