org.beepcore.beep.profile.sasl.otp.algorithm.sha1
Class SHA1
java.lang.Object
|
+--org.beepcore.beep.profile.sasl.otp.algorithm.AlgorithmImpl
|
+--org.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).
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHA1
public SHA1()
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
- Returns:
- byte[] the hash value in binary form.
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
- 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.