def calculate_checksum(type: nil, local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true )
      type ||= DEFAULT_CHECKSUM_HASH_TYPE
      mdp = JSS::DistributionPoint.master_distribution_point api: @api

      if local_file
        file_to_calc = local_file
      else
        if rw_pw
          dppw = rw_pw
          mnt = :rw
        elsif ro_pw
          dppw = ro_pw
          mnt = :ro
        else
          raise ArgumentError, 'Either rw_pw: or ro_pw: must be provided'
        end
        file_to_calc = mdp.mount(dppw, mnt) + "#{DIST_POINT_PKGS_FOLDER}/#{@filename}"
      end
      new_checksum = self.class.calculate_checksum(file_to_calc, type)
      mdp.unmount if unmount && mdp.mounted?
      new_checksum
    end
def calculate_checksum(type: nil, local_file: nil, rw_pw: nil, ro_pw: nil, unmount: true )
      type ||= DEFAULT_CHECKSUM_HASH_TYPE
      mdp = JSS::DistributionPoint.master_distribution_point api: @api

      if local_file
        file_to_calc = local_file
      else
        if rw_pw
          dppw = rw_pw
          mnt = :rw
        elsif ro_pw
          dppw = ro_pw
          mnt = :ro
        else
          raise ArgumentError, 'Either rw_pw: or ro_pw: must be provided'
        end
        file_to_calc = mdp.mount(dppw, mnt) + "#{DIST_POINT_PKGS_FOLDER}/#{@filename}"
      end
      new_checksum = self.class.calculate_checksum(file_to_calc, type)
      mdp.unmount if unmount && mdp.mounted?
      new_checksum
    end
Caclulate and return the checksum hash for a given local file, or the file
 on the master dist point if no local file is given.

 @param type [String] The checksum hash type, one of the keys of
   CHECKSUM_HASH_TYPES

 @param local_file [String, Pathname] A local copy of the pkg file. BE SURE
   it's identical to the one on the server. If omitted, the master dist.
   point will be mounted and the file read from there.

 @param rw_pw [String] The read-write password for mounting the master dist
   point. Either this or the ro_pw must be provided if no local_file

 @param ro_pw [String] The read-onlypassword for mounting the master dist
   point. Either this or the rw_pw must be provided if no local_file

 @param unmount [Boolean] Unmount the master dist point after using it.
   Only used if the dist point is mounted. default: true

 @return [String] The calculated checksum