/** * Get all discovered ciphers. This is determine by examining all providers * for their ciphers and producing a unique list. * * @return all ciphers */ public static String[] getAllCiphers() { List ciphers = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i] .getSupportedCiphers(SshConfiguration.SSH1_OR_SSH2); addList(ciphers, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) ciphers.toArray(new String[0]); }
/** * Get all discovered ciphers. This is determine by examining all providers * for their ciphers and producing a unique list. * * @return all ciphers */ public static String[] getAllCiphers() { List ciphers = new ArrayList(); SshProvider[] providers = getAllProviders(); for (int i = 0; i < providers.length; i++) { try { List c = providers[i] .getSupportedCiphers(SshConfiguration.SSH1_OR_SSH2); addList(ciphers, c); } catch (UnsatisfiedLinkError ule) { System.out .println("WARNING: Provider requires a native library but it could not be found." + ule.getMessage()); } catch (Exception ex) { System.out.println("WARNING: Provider failed to load. " + ex.getMessage()); ex.printStackTrace(); } } return (String[]) ciphers.toArray(new String[0]); }
static void dumpClientInfo(SshClient client) { System.out.println("Provider: " + client.getProvider().getClass().getName()); System.out.println("Client: " + client.getClass().getName()); System.out.println("Capabilities: " + client.getProvider().getCapabilities()); int protocolVersion = client.getConfiguration().getProtocolVersion(); System.out.println("Ciphers: " + client.getProvider().getSupportedCiphers(protocolVersion)); if (protocolVersion != SshConfiguration.SSH1_ONLY) { System.out.println("MAC: " + client.getProvider().getSupportedMAC()); System.out.println("Compression: " + client.getProvider().getSupportedCompression()); System.out.println("Key Exchange: " + client.getProvider().getSupportedKeyExchange()); System.out.println("Public Key: " + client.getProvider().getSupportedPublicKey()); } }
for (int k = 0; k < providers.length; k++) { bui.append(" <td>"); if (providers[k].getSupportedCiphers(SshConfiguration.SSH1_OR_SSH2).contains(strArrs[0][i])) { bui.append("X");
for (int k = 0; k < providers.length; k++) { try { if (providers[k].getSupportedCiphers( SshConfiguration.SSH1_OR_SSH2).contains( strArrs[0][i])) {