com.monica.javacom.ssh
Class MJCSSHSHA1
java.lang.Object
|
+--com.monica.javacom.ssh.MJCSSHSHA1
- All Implemented Interfaces:
- MJCSSHHashAlgorithm
- public class MJCSSHSHA1
- extends java.lang.Object
- implements MJCSSHHashAlgorithm
Class for providing SHA1 functionality as described in FIPS-180-1
Constructor Summary |
MJCSSHSHA1()
Default constructor. |
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 data)
Returns the hash value of the given String as BigInteger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MJCSSHSHA1
public MJCSSHSHA1()
- Default constructor.
getHashAlgorithmName
public java.lang.String getHashAlgorithmName()
- Description copied from interface:
MJCSSHHashAlgorithm
- Returns the MJC name of the MJCSSHHashAlgorithm.
- Specified by:
getHashAlgorithmName
in interface MJCSSHHashAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHHashAlgorithm
- Returns:
- String: the MJC name of the MJCSSHHashAlgorithm
getHashAlgorithmVersion
public java.lang.String getHashAlgorithmVersion()
- Description copied from interface:
MJCSSHHashAlgorithm
- Returns the MJC version of the MJCSSHHashAlgorithm.
- Specified by:
getHashAlgorithmVersion
in interface MJCSSHHashAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHHashAlgorithm
- Returns:
- String: the MJC version of the MJCSSHHashAlgorithm
getHashLength
public int getHashLength()
- Description copied from interface:
MJCSSHHashAlgorithm
- Returns the length of the hash value (as String) in number of bytes.
- Specified by:
getHashLength
in interface MJCSSHHashAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHHashAlgorithm
- Returns:
- int: the length of the hash value
hash
public java.lang.String hash(java.lang.String s)
- Description copied from interface:
MJCSSHHashAlgorithm
- Returns the hash value of the given String.
- Specified by:
hash
in interface MJCSSHHashAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHHashAlgorithm
- 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 data)
- Description copied from interface:
MJCSSHHashAlgorithm
- 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.
- Specified by:
hashAsBigInteger
in interface MJCSSHHashAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHHashAlgorithm
- Parameters:
String
- s: the String to be hashed- Returns:
- BigInteger: the hash value of the given String