docs: def finalize_integrity(self):
          # type: (Descriptor) -> None
          """Finalize integrity check for download
          :param Descriptor self: this
          """
          with self._meta_lock:
              if self._finalized:
                  return
          # check final file integrity
          check = False
          msg = None
          if self.hmac is not None:
              mac = self._ase.encryption_metadata.encryption_authentication.\
                  message_authentication_code
              digest = blobxfer.util.base64_encode_as_string(self.hmac.digest())
              if digest == mac:
                  check = True
              msg = '{}: {}, {} {} <L..R> {}'.format(
                  self._ase.encryption_metadata.encryption_authentication.
                  algorithm,
                  'OK' if check else 'MISMATCH',
                  self._ase.path,
                  digest,
                  mac,
              )
          elif self.md5 is not None:
              digest = blobxfer.util.base64_encode_as_string(self.md5.digest())
              if digest == self._ase.md5:
                  check = True
              msg = 'MD5: {}, {} {} <L..R> {}'.format(
                  'OK' if check else 'MISMATCH',
                  self._ase.path,
                  digest,
                  self._ase.md5,
              )
          else:
              check = True
              msg = 'MD5: SKIPPED, {} None <L..R> {}'.format(
                  self._ase.path,
                  self._ase.md5
              )
          # cleanup if download failed
          if not check:
              self._integrity_failed = True
              logger.error(msg)
          else:
              logger.info(msg)