com.monica.javacom.interfaces
Interface MJCSSHHashAlgorithm

All Known Implementing Classes:
MJCSSHSHA1, MJCSSHMD5

public interface MJCSSHHashAlgorithm

Hash algorithm used by the SSH layer. Provides functionality for hashing Strings.


Method Summary
 java.lang.String getHashAlgorithmName()
          Returns the MJC name of the MJCSSHHashAlgorithm.
 java.lang.String getHashAlgorithmVersion()
          Returns the MJC version of the MJCSSHHashAlgorithm.
 int getHashLength()
          Returns the length of the hash value (as String) in number of bytes.
 java.lang.String hash(java.lang.String s)
          Returns the hash value of the given String.
 java.math.BigInteger hashAsBigInteger(java.lang.String s)
          Returns the hash value of the given String as BigInteger.
 

Method Detail

getHashAlgorithmName

public java.lang.String getHashAlgorithmName()
Returns the MJC name of the MJCSSHHashAlgorithm.
Returns:
String: the MJC name of the MJCSSHHashAlgorithm

getHashAlgorithmVersion

public java.lang.String getHashAlgorithmVersion()
Returns the MJC version of the MJCSSHHashAlgorithm.
Returns:
String: the MJC version of the MJCSSHHashAlgorithm

hash

public java.lang.String hash(java.lang.String s)
Returns the hash value of the given String.
Parameters:
String - s: the String to be hashed
Returns:
String: the hash value of the given String

hashAsBigInteger

public java.math.BigInteger hashAsBigInteger(java.lang.String s)
Returns the hash value of the given String as BigInteger. Converting the hash value from String to BigInteger is done as follows: the String hash value is interpreted as a nonnegative integer number with s.charAt(0) as MSB and s.charAt(s.length()-1) as LSB.
Parameters:
String - s: the String to be hashed
Returns:
BigInteger: the hash value of the given String

getHashLength

public int getHashLength()
Returns the length of the hash value (as String) in number of bytes.
Returns:
int: the length of the hash value