Class MACGenerator

  • All Implemented Interfaces:
    IGenerator

    public class MACGenerator
    extends Object
    implements IGenerator
    MACGenerator class implements the IGenerator interface and provides the mechanism to generate MAC for the data which is then used for checking for tampering.
    • Constructor Detail

      • MACGenerator

        public MACGenerator()
    • Method Detail

      • generateLogField

        public String generateLogField​(String data,
                                       Object[] params)
                                throws Exception
        Computes the MAC of the given data and converts it to string and returns it back.
        Specified by:
        generateLogField in interface IGenerator
        Parameters:
        data - is the data on which the MAC is to be calculated.
        params - is an array of required objects for computing the MAC
        Returns:
        a String representing the generated MAC value for the given data.
        Throws:
        Exception - if it fails to generate mac value for log entry