NoSuchAlgorithmException lastException = null;
  public static CertPathBuilder getInstance(String algorithm)    throws NoSuchAlgorithmException  {    Provider[] p = Security.getProviders();    for (int i = 0; i < p.length; i++)      {        try          {            return getInstance(algorithm, p[i]);          }        catch (NoSuchAlgorithmException e)          {	    // Ignored.          }      }    throw new NoSuchAlgorithmException(algorithm);  }