private boolean verifySignature(String[] record,int signPos,int recPos) throws Exception {
  String curSign=record[signPos];
  byte[] prevMAC=helper.toByteArray(curMAC);
  byte[] newMAC;
  if ((prevSignature == null) || prevSignature.equals("")) {
    newMAC=new byte[prevMAC.length];
    System.arraycopy(prevMAC,0,newMAC,0,prevMAC.length);
  }
 else {
    newMAC=new byte[prevMAC.length + helper.toByteArray(prevSignature).length];
    System.arraycopy(prevMAC,0,newMAC,0,prevMAC.length);
    System.arraycopy(helper.toByteArray(prevSignature),0,newMAC,prevMAC.length,helper.toByteArray(prevSignature).length);
  }
  if (recPos != 0) {
    prevSignature=curSign;
  }
  verified=helper.verifySignature(helper.toByteArray(curSign),newMAC);
  return verified;
}

private boolean verifySignature ( String [ ] record , int signPos , int recPos ) throws Exception { String curSign = record [ signPos ] ; byte [ ] prevMAC = helper . toByteArray ( curMAC ) ; byte [ ] newMAC ; if ( ( prevSignature == null ) || prevSignature . equals ( "" ) ) { newMAC = new byte [ prevMAC . length ] ; System . arraycopy ( prevMAC , 0 , newMAC , 0 , prevMAC . length ) ; } else { newMAC = new byte [ prevMAC . length + helper . toByteArray ( prevSignature ) . length ] ; System . arraycopy ( prevMAC , 0 , newMAC , 0 , prevMAC . length ) ; System . arraycopy ( helper . toByteArray ( prevSignature ) , 0 , newMAC , prevMAC . length , helper . toByteArray ( prevSignature ) . length ) ; } if ( recPos != 0 ) { prevSignature = curSign ; } verified = helper . verifySignature ( helper . toByteArray ( curSign ) , newMAC ) ; return verified ; }
verifies the signature entry in the log file for tampering .
