com.monica.javacom.ssh
Class MJCSSHNoneMAC
java.lang.Object
|
+--com.monica.javacom.ssh.MJCSSHNoneMAC
- All Implemented Interfaces:
- MJCSSHMACAlgorithm
- public class MJCSSHNoneMAC
- extends java.lang.Object
- implements MJCSSHMACAlgorithm
Class for implementing the "none" MAC algorithm, eg. no MAC at all.
Method Summary |
boolean |
authenticate(java.lang.String data,
java.lang.String MAC,
java.lang.String secret)
Authenticates a message String (data) with a specified MAC String (MAC) accoring
to the specified shared secret String (secret). |
java.lang.String |
createMAC(java.lang.String data,
java.lang.String secret)
Creates the Message Authentication Code for the provided String (data)
according to the provided shared secret String (secret). |
java.lang.String |
getMACAlgorithmName()
Returns the MJC name of the MJCSSHMACAlgorithm. |
java.lang.String |
getMACAlgorithmVersion()
Returns the MJC version of the MJCSSHMACAlgorithm. |
int |
getMACLength()
Return the length of the MAC in bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MJCSSHNoneMAC
public MJCSSHNoneMAC()
getMACAlgorithmName
public java.lang.String getMACAlgorithmName()
- Description copied from interface:
MJCSSHMACAlgorithm
- Returns the MJC name of the MJCSSHMACAlgorithm.
- Specified by:
getMACAlgorithmName
in interface MJCSSHMACAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHMACAlgorithm
- Returns:
- String: the MJC name of the MJCSSHMACAlgorithm
getMACAlgorithmVersion
public java.lang.String getMACAlgorithmVersion()
- Description copied from interface:
MJCSSHMACAlgorithm
- Returns the MJC version of the MJCSSHMACAlgorithm.
- Specified by:
getMACAlgorithmVersion
in interface MJCSSHMACAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHMACAlgorithm
- Returns:
- String: the MJC version of the MJCSSHMACAlgorithm
createMAC
public java.lang.String createMAC(java.lang.String data,
java.lang.String secret)
- Description copied from interface:
MJCSSHMACAlgorithm
- Creates the Message Authentication Code for the provided String (data)
according to the provided shared secret String (secret).
- Specified by:
createMAC
in interface MJCSSHMACAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHMACAlgorithm
- Parameters:
String
- data: the data for which the MAC has to be createdString
- secret: the shared secret for the MAC creation- Returns:
- String: the resulting MAC
authenticate
public boolean authenticate(java.lang.String data,
java.lang.String MAC,
java.lang.String secret)
- Description copied from interface:
MJCSSHMACAlgorithm
- Authenticates a message String (data) with a specified MAC String (MAC) accoring
to the specified shared secret String (secret). Returns true if Message
Authentication was successful.
- Specified by:
authenticate
in interface MJCSSHMACAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHMACAlgorithm
- Parameters:
String
- data: the message bodyString
- MAC: the Message Authentication Code for the message bodyString
- secret: the shared secret for authenticating- Returns:
- boolean: wether the authentication was successful or not
getMACLength
public int getMACLength()
- Description copied from interface:
MJCSSHMACAlgorithm
- Return the length of the MAC in bytes.
- Specified by:
getMACLength
in interface MJCSSHMACAlgorithm
- Following copied from interface:
com.monica.javacom.interfaces.MJCSSHMACAlgorithm
- Returns:
- int: the length of the MAC in bytes