@Test public void testKexAlgorithmsDefault() throws IOException { String kexAlgorithms = "diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1"; List<KeyExchangeFactory> list = SshUtils.buildKexAlgorithms(kexAlgorithms.split(",")); for (String kex : kexAlgorithms.split(",")) { boolean found = false; for (KeyExchangeFactory factory : list) { if (factory.getName().equalsIgnoreCase(kex)) { found = true; break; } } if (!found) { Assert.fail("Configured default key exchange algorithm '" + kex + "' cannot be resolved"); } } }
public static List<KeyExchangeFactory> buildKexAlgorithms(String[] names) { ServerConfig defaults = new ServerConfig(); List<KeyExchangeFactory> avail = defaults.getKeyExchangeFactories(); return filter(avail, names); }
SshUtils { public static List<KeyExchangeFactory> buildKexAlgorithms(String[] names) { ServerConfig defaults = new ServerConfig(); List<KeyExchangeFactory> avail = defaults.getKeyExchangeFactories(); return filter(avail, names); } }
SshUtils { public static List<KeyExchangeFactory> buildKexAlgorithms(String[] names) { ServerConfig defaults = new ServerConfig(); List<KeyExchangeFactory> avail = defaults.getKeyExchangeFactories(); return filter(avail, names); }  }
SshUtils { public static List<KeyExchangeFactory> buildKexAlgorithms(String[] names) { ServerConfig defaults = new ServerConfig(); List<KeyExchangeFactory> avail = defaults.getKeyExchangeFactories(); return filter(avail, names); }  static List<NamedFactory<S>> filter(Class<S> type,
            Collection<NamedFactory<S>> factories, String[] names); static List<KeyExchangeFactory> filter(List<KeyExchangeFactory> factories, String[] names); static List<NamedFactory<Mac>> buildMacs(String[] names); static List<NamedFactory<Cipher>> buildCiphers(String[] names); static List<KeyExchangeFactory> buildKexAlgorithms(String[] names); }
SshUtils { public static List<KeyExchangeFactory> buildKexAlgorithms(String[] names) { ServerConfig defaults = new ServerConfig(); List<KeyExchangeFactory> avail = defaults.getKeyExchangeFactories(); return filter(avail, names); }  static List<NamedFactory<S>> filter(Class<S> type,
            Collection<NamedFactory<S>> factories, String[] names); static List<KeyExchangeFactory> filter(List<KeyExchangeFactory> factories, String[] names); static List<NamedFactory<Mac>> buildMacs(String[] names); static List<NamedFactory<Cipher>> buildCiphers(String[] names); static List<KeyExchangeFactory> buildKexAlgorithms(String[] names);  }