public byte[] signMAC(byte[] mac) throws Exception {
  try {
    PrivateKey loggerPrivKey=null;
    try {
      loggerPrivKey=ksManager.getPrivateKey(loggerKey);
    }
 catch (    Exception e) {
      Debug.error("SecureLogHelper.signMAC() : " + " Exception : ",e);
    }
    Signature loggerSign=Signature.getInstance(signingAlgorithm);
    loggerSign.initSign(loggerPrivKey);
    loggerSign.update(mac);
    byte[] signedBytes=loggerSign.sign();
    writeToSecretStore(signedBytes,logFileName,loggerPass,currentSignature);
    return signedBytes;
  }
 catch (  Exception e) {
    Debug.error("SecureLogHelper.signMAC() : " + " Exception : ",e);
    throw new Exception(e.getMessage());
  }
}

public byte [ ] signMAC ( byte [ ] mac ) throws Exception { try { PrivateKey loggerPrivKey = null ; try { loggerPrivKey = ksManager . getPrivateKey ( loggerKey ) ; } catch ( Exception e ) { Debug . error ( "SecureLogHelper.signMAC() : " + " Exception : " , e ) ; } Signature loggerSign = Signature . getInstance ( signingAlgorithm ) ; loggerSign . initSign ( loggerPrivKey ) ; loggerSign . update ( mac ) ; byte [ ] signedBytes = loggerSign . sign ( ) ; writeToSecretStore ( signedBytes , logFileName , loggerPass , currentSignature ) ; return signedBytes ; } catch ( Exception e ) { Debug . error ( "SecureLogHelper.signMAC() : " + " Exception : " , e ) ; throw new Exception ( e . getMessage ( ) ) ; } }
signs the given mac
