public final boolean verifySignAndSeqNumber(byte[] optionalHeader,byte[] data,int offset,int len,byte[] optionalTrailer) throws GSSException {
  byte[] myChecksum=getChecksum(optionalHeader,data,offset,len,optionalTrailer);
  if (MessageDigest.isEqual(checksum,myChecksum)) {
    seqNumberData=cipherHelper.decryptSeq(checksum,encSeqNumber,0,8);
    byte directionByte=0;
    if (initiator)     directionByte=(byte)0xff;
    if ((seqNumberData[4] == directionByte) && (seqNumberData[5] == directionByte) && (seqNumberData[6] == directionByte)&& (seqNumberData[7] == directionByte))     return true;
  }
  return false;
}

public final boolean verifySignAndSeqNumber ( byte [ ] optionalHeader , byte [ ] data , int offset , int len , byte [ ] optionalTrailer ) throws GSSException { byte [ ] myChecksum = getChecksum ( optionalHeader , data , offset , len , optionalTrailer ) ; if ( MessageDigest . isEqual ( checksum , myChecksum ) ) { seqNumberData = cipherHelper . decryptSeq ( checksum , encSeqNumber , 0 , 8 ) ; byte directionByte = 0 ; if ( initiator ) directionByte = ( byte ) 0xff ; if ( ( seqNumberData [ 4 ] == directionByte ) && ( seqNumberData [ 5 ] == directionByte ) && ( seqNumberData [ 6 ] == directionByte ) && ( seqNumberData [ 7 ] == directionByte ) ) return true ; } return false ; }
verifies that the checksum field and sequence number direction bytes are valid and consistent with the application data .
