public byte[] calculateChecksum(byte[] data,int size) throws KrbCryptoException {
  MessageDigest md5;
  byte[] result=null;
  try {
    md5=MessageDigest.getInstance("MD5");
  }
 catch (  Exception e) {
    throw new KrbCryptoException("JCE provider may not be installed. " + e.getMessage());
  }
  try {
    md5.update(data);
    result=md5.digest();
  }
 catch (  Exception e) {
    throw new KrbCryptoException(e.getMessage());
  }
  return result;
}

public byte [ ] calculateChecksum ( byte [ ] data , int size ) throws KrbCryptoException { MessageDigest md5 ; byte [ ] result = null ; try { md5 = MessageDigest . getInstance ( "MD5" ) ; } catch ( Exception e ) { throw new KrbCryptoException ( "JCE provider may not be installed. " + e . getMessage ( ) ) ; } try { md5 . update ( data ) ; result = md5 . digest ( ) ; } catch ( Exception e ) { throw new KrbCryptoException ( e . getMessage ( ) ) ; } return result ; }
calculates checksum using md5 .
