com.monica.javacom.interfaces
Interface MJCSSHMACAlgorithm

All Known Implementing Classes:
MJCSSHHMAC, MJCSSHNoneMAC

public interface MJCSSHMACAlgorithm

Provides Message Authentication functionality for the SSH layer.


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.
 

Method Detail

getMACAlgorithmName

public java.lang.String getMACAlgorithmName()
Returns the MJC name of the MJCSSHMACAlgorithm.
Returns:
String: the MJC name of the MJCSSHMACAlgorithm

getMACAlgorithmVersion

public java.lang.String getMACAlgorithmVersion()
Returns the MJC version of the MJCSSHMACAlgorithm.
Returns:
String: the MJC version of the MJCSSHMACAlgorithm

createMAC

public 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).
Parameters:
String - data: the data for which the MAC has to be created
String - 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)
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.
Parameters:
String - data: the message body
String - MAC: the Message Authentication Code for the message body
String - secret: the shared secret for authenticating
Returns:
boolean: wether the authentication was successful or not

getMACLength

public int getMACLength()
Return the length of the MAC in bytes.
Returns:
int: the length of the MAC in bytes