MessageDigest md = MessageDigest.getInstance(alg);
MessageDigest md = MessageDigest.getInstance(alg, provider);
  private boolean verifyHashes(String entry, Attributes attr)  {    int verified = 0;    // The bytes for ENTRY's manifest entry, which are signed in the    // signature file.    byte[] entryBytes = null;    try      {	ZipEntry e = super.getEntry(entry);	if (e == null)	  {	    if (DEBUG)	      debug("verifyHashes: no entry '" + entry + "'");	    return false;	  }        entryBytes = readManifestEntry(e);      }    catch (IOException ioe)      {        if (DEBUG)          {            debug(ioe);            ioe.printStackTrace();          }        return false;      }    for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )      {        Map.Entry e = (Map.Entry) it.next();        String key = String.valueOf(e.getKey());        if (!key.endsWith(DIGEST_KEY_SUFFIX))          continue;        String alg = key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length());        try          {            byte[] hash = Base64InputStream.decode((String) e.getValue());            MessageDigest md = MessageDigest.getInstance(alg);            md.update(entryBytes);            byte[] hash2 = md.digest();            if (DEBUG)              debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm()                    + " expect=" + new java.math.BigInteger(hash).toString(16)                    + " comp=" + new java.math.BigInteger(hash2).toString(16));            if (!Arrays.equals(hash, hash2))              return false;            verified++;          }        catch (IOException ioe)          {            if (DEBUG)              {                debug(ioe);                ioe.printStackTrace();              }            return false;          }        catch (NoSuchAlgorithmException nsae)          {            if (DEBUG)              {                debug(nsae);                nsae.printStackTrace();              }            return false;          }      }    // We have to find at least one valid digest.    return verified > 0;  }