}
  protected void setKeystoreURLParam(String url) throws IOException,      KeyStoreException, UnsupportedCallbackException, NoSuchAlgorithmException,      CertificateException  {    log.finest("setKeystoreURLParam(" + url + ")"); //$NON-NLS-1$ //$NON-NLS-2$    if (url == null || url.trim().length() == 0)      {        String userHome = SystemProperties.getProperty("user.home"); //$NON-NLS-1$        if (userHome == null || userHome.trim().length() == 0)          throw new InvalidParameterException(Messages.getString("Command.36")); //$NON-NLS-1$        url = userHome.trim() + "/.keystore"; //$NON-NLS-1$        // if it does not exist create it        new File(url).createNewFile();        url = "file:" + url; //$NON-NLS-1$      }    else      {        url = url.trim();        if (url.indexOf(":") == -1) // if it does not exist create it //$NON-NLS-1$          new File(url).createNewFile();        url = "file:" + url; //$NON-NLS-1$      }    boolean newKeyStore = false;    storeURL = new URL(url);    storeStream = storeURL.openStream();    if (storeStream.available() == 0)      {        log.fine("Store is empty. Will use <null> when loading, to create it"); //$NON-NLS-1$        newKeyStore = true;      }    try      {        store = KeyStore.getInstance(storeType);      }    catch (KeyStoreException x)      {        if (provider != null)          throw x;        log.fine("Exception while getting key store with default provider(s)." //$NON-NLS-1$                 + " Will prompt user for another provider and continue"); //$NON-NLS-1$        String prompt = Messages.getString("Command.40"); //$NON-NLS-1$        NameCallback ncb = new NameCallback(prompt);        getCallbackHandler().handle(new Callback[] { ncb });        String className = ncb.getName();        setProviderClassNameParam(className); // we may have a Provider        if (provider == null)          {            x.fillInStackTrace();            throw x;          }        // try again        store = KeyStore.getInstance(storeType, provider);      }    // now we have a KeyStore instance. load it    // KeyStore public API claims: "...In order to create an empty keystore,    // you pass null as the InputStream argument to the load method.    if (newKeyStore)      store.load(null, storePasswordChars);    else      store.load(storeStream, storePasswordChars);    // close the stream    try    {      storeStream.close();      storeStream = null;    }    catch (IOException x)    {      log.fine("Exception while closing the key store input stream: " + x //$NON-NLS-1$               + ". Ignore"); //$NON-NLS-1$    }  }