org.beepcore.beep.profile.sasl.otp.algorithm.sha1
Class SHA1

java.lang.Object
  extended byorg.beepcore.beep.profile.sasl.otp.algorithm.AlgorithmImpl
      extended byorg.beepcore.beep.profile.sasl.otp.algorithm.sha1.SHA1
All Implemented Interfaces:
Algorithm

public class SHA1
extends AlgorithmImpl

This class does the 'funky OTP stuff' to the SHA1 hash (basically folds it to 64 bits and makes it little endian).


Field Summary
 
Fields inherited from interface org.beepcore.beep.profile.sasl.otp.algorithm.Algorithm
ERR_HASH_FAILURE
 
Constructor Summary
SHA1()
           
 
Method Summary
protected  byte[] foldHash(byte[] hash)
          Method foldHash is provided for implementations, as the value of the message digest hash must be folding into 64 bits before it can be used by the SASLOTPProfile and its supporting classes.
 byte[] generateHash(byte[] hash)
          Method generateHash generate a hash value using the appropriate hash function.
static java.lang.String getAlgorithmName()
           
 java.lang.String getName()
          Method getName
 
Methods inherited from class org.beepcore.beep.profile.sasl.otp.algorithm.AlgorithmImpl
generateHash
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA1

public SHA1()
Method Detail

getName

public java.lang.String getName()
Description copied from class: AlgorithmImpl
Method getName

Specified by:
getName in interface Algorithm
Specified by:
getName in class AlgorithmImpl

getAlgorithmName

public static java.lang.String getAlgorithmName()

generateHash

public byte[] generateHash(byte[] hash)
                    throws InvalidParameterException
Description copied from class: AlgorithmImpl
Method generateHash generate a hash value using the appropriate hash function.

Specified by:
generateHash in interface Algorithm
Overrides:
generateHash in class AlgorithmImpl
Parameters:
hash - The data to be hashed
Returns:
byte[] the hash value in binary form.
Throws:
InvalidParameterException

foldHash

protected byte[] foldHash(byte[] hash)
                   throws InvalidParameterException
Description copied from class: AlgorithmImpl
Method foldHash is provided for implementations, as the value of the message digest hash must be folding into 64 bits before it can be used by the SASLOTPProfile and its supporting classes.

Specified by:
foldHash in class AlgorithmImpl
Parameters:
hash - The hash value to be folded
Returns:
byte[] is the folded hash.
Throws:
InvalidParameterException - of the has provided is somehow improper or invalid.


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