docs: public KeyStore getKeyStore(String name, String type, String provider, String fileName, String password, boolean create, SSLConfig sslConfig) throws Exception {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "getKeyStore", new Object[] { name, type, provider, fileName, Boolean.valueOf(create), SSLConfigManager.mask(password) });
  
          if (name != null && !create) {
              WSKeyStore keystore = keyStoreMap.get(name);
  
              if (keystore != null) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      Tr.exit(tc, "getKeyStore (from WSKeyStore)");
                  return keystore.getKeyStore(false, false);
              }
          }
  
          KeyStore keyStore = null;
          InputStream inputStream = null;
          boolean not_finished = true;
          int retry_count = 0;
          boolean fileBased = true;
          List<String> keyStoreTypes = new ArrayList<String>();
  
          // Loop until flag indicates a key store was found or failure occured.
          while (not_finished) {
              // Get a base instance of the keystore based on the type and or the
              // provider.
              if (Constants.KEYSTORE_TYPE_JCERACFKS.equals(type) || Constants.KEYSTORE_TYPE_JCECCARACFKS.equals(type) || Constants.KEYSTORE_TYPE_JCEHYBRIDRACFKS.equals(type))
                  fileBased = false;
              else
                  fileBased = true;
  
              // Get a base instance of the keystore based on the type and or the
              // provider.
              char[] passphrase = null;
              keyStore = KeyStore.getInstance(type);
              // Convert the key store password into a char array.
              if (password != null) {
                  passphrase = WSKeyStore.decodePassword(password).toCharArray();
              }
  
              // Open the file specified by the input parms as the keystore file.
              try {
                  if (Constants.KEYSTORE_TYPE_JAVACRYPTO.equals(type)) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(tc, "Creating PKCS11 keystore.");
  
                      WSPKCSInKeyStore pKS = pkcsStoreList.insert(type, fileName, password, false, provider);
  
                      if (pKS != null) {
                          keyStore = pKS.getKS();
                          not_finished = false;
                      }
                  } else if (null == fileName) {
                      keyStore.load(null, passphrase);
                      not_finished = false;
                  } else {
                      File f = new File(fileName);
  
                      FileExistsAction action = new FileExistsAction(f);
                      Boolean fileExists = AccessController.doPrivileged(action);
  
                      if (!fileExists.booleanValue() && fileBased) {
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, "getKeyStore created new KeyStore: " + fileName);
                          }
                          keyStore.load(null, passphrase);
                          not_finished = false;
                      } else {
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, "getKeyStore created a new inputStream: " + fileName);
                          }
                          // Access the keystore input stream from a File or URL
                          inputStream = getInputStream(fileName, create);
                          keyStore.load(inputStream, passphrase);
                          not_finished = false;
                      }
                  }
              } catch (IOException e) {
                  // Check for well known error conditions.
                  if (e.getMessage().equalsIgnoreCase("Invalid keystore format") || e.getMessage().indexOf("DerInputStream.getLength()") != -1) {
                      if (retry_count == 0) {
                          String alias = "unknown";
                          if (sslConfig != null) {
                              alias = sslConfig.getProperty(Constants.SSLPROP_ALIAS);
                          }
  
                          Tr.warning(tc, "ssl.keystore.type.invalid.CWPKI0018W", new Object[] { type, alias });
                          keyStoreTypes = new ArrayList<String>(Security.getAlgorithms("KeyStore"));
                      }
  
                      // Limit the number of retries.
                      if (retry_count >= keyStoreTypes.size()) {
                          throw e;
                      }
  
                      // Adjust the type for another try.
                      // We'll go through all available types.
                      type = keyStoreTypes.get(retry_count++);
                      if (type.equals("PKCS11") || type.equals("IBMCMSKS")) {
                          type = keyStoreTypes.get(retry_count++);
                      }
  
                  } else {
                      // Unknown error condition.
                      throw e;
                  }
              } finally {
                  if (inputStream != null)
                      inputStream.close();
              }
          } // end while
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "getKeyStore (from SSLConfig properties)");
          return keyStore;
      }